Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Python: draw a figure about graph theory and networks

  • 11-02-2016 01:50PM
    #1
    Registered Users, Registered Users 2 Posts: 3


    I would like to draw a figure from complex formula about graph theory and networks by python. The formula is λmin(H)/λmax(H)<2k/nd(H). Let G1 , G2 be two graphs on n1 and n2 vertices, respectively, and let H be the graph obtained by adding k edges between G1 and G2. λ is eigenvalue.

    Then, the ratio 􏰁λmin/λ􏰁max for two copies of a random graph G of 500 vertices connected to each other by 20 links.

    I tried like following but it must be wrong.

    from __future__ import division
    import pylab
    import numpy as np
    import matplotlib.pyplot as plt

    plt.plot( [0])
    plt.legend()

    x = np.linspace(0,120,121)
    y = 2*20 / 500*x
    plt.plot(x,y)

    plt.xlim([0,120])
    plt.ylim([0.0001,100])

    plt.yscale("log")

    plt.title("Graph Synchronization")
    plt.xlabel("p")
    plt.ylabel("lamda-min / lamda-max")
    plt.show()
    Tagged:


Advertisement