import sys
import sumograph
import networkx as nx
import matplotlib.pyplot as plt

in_text = ['Human', 'LegalAgent']
g = sumograph.SumoGraph()

print 'Building...'
g.build_graph('/home/pkedzia/repos/plumper/resources/sumo_graph')

print 'Weighting...'
g.weight_all_nodes(1.0 * len(g.G().nodes()))

print 'Modifying...'
g.modify_nodes_weight(in_text, 1.0)

print 'One more weighting...'
g.weight_all_edges(g._nodes_weight_sum)

print 'All minimal subgraphs...'
g_sgraphs = g.all_minimal_subgraphs(in_text)
for g in g_sgraphs:
    print g.edges()
'''
for i, s_graph in enumerate(g_sgraphs):
    plt.figure(i)
    nx.draw(s_graph, with_labels=True)
plt.show()
'''

if __name__ == '__main__':
    print >> sys.stderr, 'Ola ma koa'
