0

I am working on a program that involves finding the longest sequence in a unweighted directed acyclic graph. I don't just need the length but also the sequence, covering the possibility of multiple sequences of the same longest length. I have tried out with DFS and Floyd-Warshall's algorithm, but have been unsuccessful so far. Could anyone give some idea as to how this question could be approached?

Thanks!

Aditya
  • 65
  • 1
  • 11
  • 1
    Does [this](https://stackoverflow.com/questions/15858303/longest-path-in-a-direct-acyclic-graph) answer your question? It's a topo. sort followed by a one variable dynamic program. – kcsquared Nov 11 '21 at 21:54
  • Not exactly...but thanks! I beat my head enough to figure out a way using DFS and points to record traversed paths and save largest ones in a 2D array(double pointer based). – Aditya Nov 12 '21 at 12:17

0 Answers0