-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Longest path #79
Add Longest path #79
Conversation
fixed code comments, naming of weak component measures and tests
Developer
Restore code falsely deleted in #64
Improve Usability
Add a function to calculate the longest path of an directed acyclic FGraph
Add function to check if graph is Cyclic
Rename check functions and add the check to the compute expressions
Add simple tests for LongestPath
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## developer #79 +/- ##
=============================================
- Coverage 32.06% 28.72% -3.35%
=============================================
Files 37 38 +1
Lines 2426 2942 +516
Branches 345 365 +20
=============================================
+ Hits 778 845 +67
- Misses 1579 2026 +447
- Partials 69 71 +2 ☔ View full report in Codecov by Sentry. |
open Graphoscope | ||
open System.Collections.Generic | ||
|
||
type LongestPath() = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LibraChris nitpick: you probably didn't need the constructor on this type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct. But this is implemented because every type annotation in this library includes this constructor. It's simply designed to conform to the established schema.
This pull request adds a new feature to Graphoscope – the Longest Path Algorithm as mentioned in #58. Additionally, it includes tests to ensure the correctness of the algorithm and checks for graph cyclicity.
Changes Made
Added Longest Path Algorithm:
Implemented an inverse Dijkstra's algorithm for finding the longest paths from a specified node in a DAG.
Introduced a new function, compute, in the Measures.LongestPath module to calculate the longest path in a directed acyclic graph (DAG).
Added a function testing if a directed graph is acyclic
Graph Cyclicity Tests:
Added tests in the Tests.Measures.LongestPathTests module to verify the correctness of the algorithm.
Included tests to ensure that the algorithm correctly identifies whether the input graph is a directed acyclic graph (DAG) or not.