As the title says I have to find longest path in directed graph where each node has at most two incoming edges and two outgoing edges. I don't know if that fact helps anything.. The graph will have at most 10000 nodes. And I need to find the longest path from node 0 to node 'Exit' which will be 10001.
I tried to code dijkstra but it didn't work.
Thanks in advance.