Skip to content

Instantly share code, notes, and snippets.

View rob-p's full-sized avatar
🎯
Focusing

Rob Patro rob-p

🎯
Focusing
View GitHub Profile
@rob-p
rob-p / WeightedConfigSampler.py
Created December 18, 2012 02:44 — forked from anonymous/WeightedConfigSampler.py
Tabs => spaces (where did tabs come from?)
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.