solving graph problems using networkx

27
Solving Graph problems using Network X

Upload: krishna-sangeeth-k-s

Post on 12-Jul-2015

192 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Solving graph problems using networkX

Solving Graph problems using Network X

Page 2: Solving graph problems using networkX

So What’s our Agenda ?

1. Getting to know Graphs2. Looking at some cool Graphs3. Playing around with Network X

Page 3: Solving graph problems using networkX

The Wonderful Story of Graphs(TL;DR version)

Page 4: Solving graph problems using networkX

In the beginning someone said … Let there be nodes.

Page 5: Solving graph problems using networkX

Nodes remained in isolation for a long time until a mysterious force said.

Let there be edges.

Page 6: Solving graph problems using networkX

- Nodes became Happy at being connected to other Nodes through edges.

- They wanted to give a name to this Union of nodes and edges, some mysterious person suggested ‘Graph’ is a cool name.

So the Nodes and Edges lived happily ever after

THE END

Page 7: Solving graph problems using networkX

Need More Info?

Wikipedia says “A graph is an ordered pair G = (V, E) comprising a set V of vertices or nodes together with a set E of edges. “

Page 8: Solving graph problems using networkX

V = {1, 2, 3, 4, 5, 6}E = {{1, 2}, {1, 5}, {2, 3}, {2, 5}, {3, 4}, {4, 5}, {4, 6}}

Page 9: Solving graph problems using networkX

Some Interesting Graphs

Page 10: Solving graph problems using networkX
Page 11: Solving graph problems using networkX
Page 12: Solving graph problems using networkX
Page 13: Solving graph problems using networkX

Where else can we see applications of Graphs ?

Page 14: Solving graph problems using networkX

& More

Page 15: Solving graph problems using networkX

NetworkX : A friendly Python library

Page 16: Solving graph problems using networkX

How to Create miserable lonely Nodes ?

Page 17: Solving graph problems using networkX

That’s how you add Edges!

Page 18: Solving graph problems using networkX

You Can Multitask , Multi add edges

Page 19: Solving graph problems using networkX

Just some housekeeping

Page 20: Solving graph problems using networkX

Generating Graphs are Super Easy !!

Page 21: Solving graph problems using networkX

Now good luck trying to draw that with hand

Page 22: Solving graph problems using networkX

This is my favourite . So don’t ask me anything about it

Page 23: Solving graph problems using networkX

We can add more details to Node and Edges.

Page 24: Solving graph problems using networkX

Reading Graphs in other Formats

Page 25: Solving graph problems using networkX

Matplotlib is not the right tool always

Page 26: Solving graph problems using networkX

Alternatives for Better Visualization

Page 27: Solving graph problems using networkX

Let’s try something ambitious now.

A) Read 1 Crore lines of edge information from a datasetB) And find the node with the highest degree.C) Calculate how much time it took for loading the graph