Wolf cabbage and goat using dijkstra. A farmer has to cross a river with a wolf, a goat and a cabbage.
He has a boat, but in the boat he can take just one thing.
He cannot let the goat alone with the wolf or the goat with the cabbage. It’s obvious why.
What is the solution?
Ok So I know the two solutions and I arrived them with trial and error. Reaching dead ends and making smart moves. But I am interested to know the solution of this problem using Dijkstra's Algorithm. I do not know what my graph should represent and how to use the shortest path algorithm to solve this puzzle.

Design the states as $S | S'$ where $S$ denotes the objects on one side of the river and $S'$ denotes the objects on the other side of the river.
Example : $WC|G$ denotes wolf and cabbage is on one side and goat on the other.
Put the appropriate transitions and run Dijkstra's algorithm.
