Slide 1

Slide 1 text

Graph Theory 101 by @another_clue putting theory into practice

Slide 2

Slide 2 text

graph theory discrete mathematics 2

Slide 3

Slide 3 text

No, not charts/diagrams! 3

Slide 4

Slide 4 text

G=(V,E) ordered set G = (V,E) V: set of vertices/nodes/points E: set of edges/connections/lines/arrows/arcs 4

Slide 5

Slide 5 text

properties empty trivial edgeless … 5

Slide 6

Slide 6 text

attributes vertex labels edge weights types … 6

Slide 7

Slide 7 text

putting into Practice 7

Slide 8

Slide 8 text

Facebook 8

Slide 9

Slide 9 text

Facebook V = people E = friends (undirected) Amy befriended with Bob 9

Slide 10

Slide 10 text

Facebook is an undirected graph 10

Slide 11

Slide 11 text

Twitter 11

Slide 12

Slide 12 text

Twitter V = accounts E = follower (directed) YourName follows @webengdus 12

Slide 13

Slide 13 text

Twitter is a digraph (directed graph) 13

Slide 14

Slide 14 text

git 14

Slide 15

Slide 15 text

git V = objects (commits, tags etc.) E = object references v1.0.0 refs #abc 15

Slide 16

Slide 16 text

git is a DAG (directed acyclic graph) 16

Slide 17

Slide 17 text

sat nav 17

Slide 18

Slide 18 text

sat nav V = cities E = roads (weight=distance) All roads lead to Rome? 18

Slide 19

Slide 19 text

sat nav multigraph (parallel edges, loops) shortest path? algorithms and heuristics 19

Slide 20

Slide 20 text

Conclusions 20

Slide 21

Slide 21 text

graphs are everywhere! 21

Slide 22

Slide 22 text

care about edges? use a graph! 22

Slide 23

Slide 23 text

graph libraries readily available 23

Slide 24

Slide 24 text

plenty of graph databases 24

Slide 25

Slide 25 text

Do you need a graph database? 25

Slide 26

Slide 26 text

// thank you! 26 @another_clue – https://lueck.tv/

Slide 27

Slide 27 text

27 Exercise

Slide 28

Slide 28 text

28 @WebEngDus Exercise

Slide 29

Slide 29 text

29 @another_clue @WebEngDus Exercise

Slide 30

Slide 30 text

30 @clue @another_clue @WebEngDus Exercise

Slide 31

Slide 31 text

31 @clue @another_clue @WebEngDus @graphp Exercise

Slide 32

Slide 32 text

32 @clue @another_clue @WebEngDus @graphp YOU! Exercise

Slide 33

Slide 33 text

More… 33

Slide 34

Slide 34 text

static analysis 34

Slide 35

Slide 35 text

static analysis V = functions E = functions invocation main() calls run() calls print() 35

Slide 36

Slide 36 text

static analysis digraph remove vertices with indegree=0 36