Skip to content

Add dynamic programming on DAG using topological sort (longest path). #1309

@sujalxverma

Description

@sujalxverma

Hi, I would like to contribute an implementation of dynamic programming on DAGs using topological sorting.

Proposed:

  • Reusable DP on DAG template.
  • Example: longest path in a DAG.
  • Time complexity: O(V + E).

I noticed that topological sort is already implemented, but there is no example showing how to combine it with dynamic programming on DAGs.

Would this be a suitable addition? I will follow the existing coding style and include tests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions