I tried this Synchronous Shopping problem on HackerRank and I had no clue how to approach it. So I looked at the editorial, and I am confused. Maybe I misunderstood how Dijkstra's single source shortest path algorithm works. This is taken from the editorial:He says The shortest distance to the state $D_{(V, B)}$ denotes the minimum time required  to visit shopping center $V$ with fish from the mask $B$ bought.and then he describes two possible ways we might move from one state to another, and after that he says When all the minimal times are calculated....I assume he means, we should have considered all possible ways to obtain fish, after we reach node $N$. All $2^k$ ways. Like, we consider 1) we only have the first fish when we reach node $N$2) we only have the second fish...3) we only have the first fish and the second fish..etc..but if we run Dijkstra, it will calculate the shortest path from node $1$ to node $N$, but we have to travel a specific path to get from node $1$ to node $N$. And we will only get the fish available along those nodes. How do we calculate all other states? (reaching node $N$ with different sets of fish)
Synchronous Shopping Hackerrank
algorithms;graphs;weighted graphs