R
R copied to clipboard
Vf2 graph isomorphism
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.