O'Reilly logo

Complex Network Analysis in Python by Dmitry Zinoviev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

NetworkX

The striking difference between the NetworkX code and the other previously shown code fragments is the ability to add named edges and nodes directly to the graph, which is a natural way of building a real-world complex network.

 lincoln_list = [
  (​"A.L."​, ​"Edward Baker L."​), (​"A.L."​, ​"Robert Todd L."​),
  (​"A.L."​, ​"William Wallace L."​), (​"A.L."​, ​"Thomas L. III"​),
  (​"Jessie Harlan L."​, ​"Mary L. Beckwith"​),
  (​"Jessie Harlan L."​, ​"Robert Todd L. Beckwith"​),
  (​"Mary L."​, ​"L. Isham"​), (​"Robert Todd L."​, ​"A.L. II"​),
  (​"Robert Todd L."​, ​"Jessie Harlan L."​),
  (​"Robert Todd L."​, ​"Mary L."​), (​"Thomas L."​, ​"A.L."​),
  (​"Thomas L."​, ​"Sarah L. Grigsby"​), (​"Thomas L." ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required