AlgoMaster Logo

Shortest Path Visiting All Nodes

graph=[[1,2,3],[0],[0],[0]]
0 / 123
0123DP Table (mask, ending node)0123
algomaster.io
Step:Start: Shortest Path Visiting All 4 Nodes using BFS + Bitmask DP