@@ -0,0 +1,656 @@
+from random import Random%0A%0Aimport networkx as nx%0A%0A%0Aclass GraphGenerator:%0A    n, m = 10, 90%0A    min_edge_cost, max_edge_cost = 0, 100%0A%0A    def __init__(self, **params):%0A        self.n = params.get('n', self.n)%0A        self.m = params.get('m', self.m)%0A        self.min_edge_cost = params.get('min_edge_cost', self.min_edge_cost)%0A        self.max_edge_cost = params.get('max_edge_cost', self.max_edge_cost)%0A%0A    def weighted_graph(self):%0A        g = nx.gnm_random_graph(self.n, self.m)%0A        r = Random()%0A%0A        for origin, target in g.edges():%0A            g%5Borigin%5D%5Btarget%5D%5B'weight'%5D = r.randint(self.min_edge_cost, self.max_edge_cost)%0A%0A        return g%0A

Add weighted graph generator.