-
-
Notifications
You must be signed in to change notification settings - Fork 342
Vf2 graph isomorphism #279
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
base: master
Are you sure you want to change the base?
Vf2 graph isomorphism #279
Conversation
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.
Pull Request Overview
This pull request adds the VF2 graph isomorphism algorithm implementation to the R algorithms repository, along with several supporting graph algorithms and dynamic programming solutions. The PR introduces a comprehensive implementation of graph isomorphism detection using the VF2 backtracking approach with feasibility checks for both node and edge compatibility.
Key Changes:
- Implemented VF2 graph isomorphism algorithm with backtracking and feasibility checks
- Added supporting graph algorithms (Kruskal's MST, topological sort, various shortest path algorithms)
- Included dynamic programming implementations (knapsack, LCS, subset sum, matrix chain multiplication)
Reviewed Changes
Copilot reviewed 143 out of 223 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
graph_algorithms/vf2_graph_isomorphism.r |
Core VF2 algorithm implementation for detecting graph isomorphism |
graph_algorithms/kruskal_mst.r |
Kruskal's minimum spanning tree with union-find data structure |
graph_algorithms/topological_sort.r |
Kahn's algorithm for topological ordering of DAGs |
graph_algorithms/yen_k_shortest_paths.r |
K shortest paths algorithm with igraph dependency |
kruskal_mst.r |
Duplicate Kruskal MST implementation at repository root |
| Multiple dynamic programming files | Various DP implementations (knapsack, LCS, subset sum, etc.) |
machine_learning/ files |
Empty .gitignore and README with tutorial links |
documentation/ files |
Generated HTML/MD documentation files |
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.
You have changed 223 files, check your changes
Determines whether two graphs are isomorphic (structurally identical).
Uses the VF2 algorithm, which is a backtracking approach with feasibility checks.
Checks both node compatibility and edge compatibility for already-mapped nodes.
Returns TRUE/FALSE indicating isomorphism, and a valid node mapping if they are isomorphic.
Input: Two graphs represented as adjacency lists.
Output: Boolean for isomorphism and mapping vector.
Time Complexity: Exponential in worst case, but efficient pruning reduces search space.
Space Complexity: O(n) for mapping and used arrays, where n is the number of nodes.