Skip to content
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

Merged
merged 9 commits into from
Dec 6, 2023
Merged

Add Longest path #79

merged 9 commits into from
Dec 6, 2023

Conversation

LibraChris
Copy link
Collaborator

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.

HarryMcCarney and others added 9 commits October 19, 2023 11:48
fixed code comments, naming of weak component measures and tests
Restore code falsely deleted in #64
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
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (447910a) 32.06% compared to head (c14106f) 28.72%.
Report is 5 commits behind head on developer.

Files Patch % Lines
src/Graphoscope/Measures/LongestPath.fs 94.36% 2 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@LibraChris LibraChris merged commit 834a429 into developer Dec 6, 2023
3 of 4 checks passed
open Graphoscope
open System.Collections.Generic

type LongestPath() =
Copy link

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.

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants