def test_networkx_graphs():
	G = nx.path_graph(10)
	mc_srw = mkm.nx_graph_srw(G)
	mc_lswr = mkm.nx_graph_lazy_srw(G)

	G = nx.hypercube_graph(10)
	print nx.number_of_nodes(G)
	mkm.nx_graph_lazy_srw(G)

	G = nx.complete_graph(50)
	print mkm.nx_graph_nbrw(G).get_n()
Example #2
0
def test_networkx_graphs():
    G = nx.path_graph(10)
    mc_srw = mkm.nx_graph_srw(G)
    mc_lswr = mkm.nx_graph_lazy_srw(G)

    G = nx.hypercube_graph(10)
    print nx.number_of_nodes(G)
    mkm.nx_graph_lazy_srw(G)

    G = nx.complete_graph(50)
    print mkm.nx_graph_nbrw(G).get_n()
def nx_graph_analyze_nbrw(G):  # pragma: no cover
    import networkx as nx
    import matplotlib.pyplot as plt

    mc = mkm.nx_graph_nbrw(G)
    mc.add_distributions(mkm.random_delta_distributions(mc.get_n(), 5))

    mc.compute_tv_mixing()

    plt.figure()
    for i in range(mc.num_distributions()):
        (x, tv) = mc.distribution_tv_mixing(i)
        plt.plot(x, tv)

    plt.xlabel("t")
    plt.ylabel("Distance to stationary distribution in total variation")
    plt.show()
def nx_graph_analyze_nbrw(G): # pragma: no cover
	import networkx as nx
	import matplotlib.pyplot as plt

	mc = mkm.nx_graph_nbrw(G)
	mc.add_distributions(mkm.random_delta_distributions(mc.get_n(),5))
	
	mc.compute_tv_mixing()

	plt.figure()
	for i in range(mc.num_distributions()):
		(x,tv) = mc.distribution_tv_mixing(i)
		plt.plot(x, tv)

	plt.xlabel("t")
	plt.ylabel("Distance to stationary distribution in total variation")
	plt.show()