from sys import argv
from random import random, randrange
from itertools import repeat
from WeightedDigraph import WeightedDigraph
from Dijkstra import Dijkstra

def report(v, dist, path):
    # print("v=%d dist=%f path=%s" % (v, dist, path))
    pass

G = WeightedDigraph(int(argv[1]))
deg_target = int(argv[2])
for v in range(G.V):
    for w in (randrange(V) for V in repeat(G.V, deg_target)):
        if v != w and not w in G.adj(v):
            G.addedge(v, w, random())

s = randrange(G.V)
search = Dijkstra(G, s)

# Report the nodes that were reached, with their distance and path
for v in range(0, G.V):
    if search.has_path_to(v):
        report(v, search.dist_to(v), search.path_to(v))
