Professor Snape has provided the young wizard Hermione with three magical batteries whose sizes are 12, 7, and 6 morts, respectively. (A mort is a unit of wizard energy.)
The 7-mort and 6-mort batteries are fully charged (containing 7 and 6 morts of energy, respectively), while the 12-mort battery is empty, with 0 morts.
Snape says that Hermione is only allowed to use, repeatedly, if necessary, the mort transfer spell when working with these batteries.
This spell transfers all the morts in one battery to another battery, and it halts the transfer either when the source battery has no morts remaining or when the destination battery is fully charged.
Snape condescendingly challenges Hermione to determine whether there exists a sequence of mort-transfer spells that leaves exactly 2 morts either in the 7-mort or in the 6-mort battery.
(a) Hermione knows this is actually a graph problem. Give a precise definition of how to model this problem as a graph, and state the specific question about this graph that must be answered.
(b) What algorithm should Hermione apply to solve the graph problem? (c) Apply that algorithm to Snapes question. Report and justify your answer.