This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
import random | |
import copy | |
def isValidPair(G, Gp): | |
''' | |
This function checks if the weighted, undirected graphs G and Gp | |
constitute a valid pair. | |
G and Gp constitute a valid pair if, for every vertex u in G and Gp, | |
the multiset of weights for u is the same in both graphs. |