$30 off During Our Annual Pro Sale. View Details »

Graph Theory 101 (WebEngDus17)

Graph Theory 101 (WebEngDus17)

Graph Theory 101 – putting theory into practice
Graphs are everywhere! Learn the core basics of graph theory and see how this can be applied in a number of practical, every-day use cases.

5min talk from ELI5 series (explain me like I'm five)
Presentation consists of slides and interactive flip-chart session (not uploaded here)

Christian Lück

July 20, 2017
Tweet

More Decks by Christian Lück

Other Decks in Programming

Transcript

  1. Graph Theory 101 by @another_clue
    putting theory into practice

    View Slide

  2. graph theory
    discrete mathematics
    2

    View Slide

  3. No, not charts/diagrams!
    3

    View Slide

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

    View Slide

  5. properties
    empty
    trivial
    edgeless
    … 5

    View Slide

  6. attributes
    vertex labels
    edge weights
    types
    … 6

    View Slide

  7. putting into Practice
    7

    View Slide

  8. Facebook
    8

    View Slide

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

    View Slide

  10. Facebook
    is an undirected graph
    10

    View Slide

  11. Twitter
    11

    View Slide

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

    View Slide

  13. Twitter
    is a digraph (directed graph)
    13

    View Slide

  14. git
    14

    View Slide

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

    View Slide

  16. git
    is a DAG (directed acyclic graph)
    16

    View Slide

  17. sat nav
    17

    View Slide

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

    View Slide

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

    View Slide

  20. Conclusions
    20

    View Slide

  21. graphs are everywhere!
    21

    View Slide

  22. care about edges? use a graph!
    22

    View Slide

  23. graph libraries readily available
    23

    View Slide

  24. plenty of graph databases
    24

    View Slide

  25. Do you need a graph database?
    25

    View Slide

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

    View Slide

  27. 27
    Exercise

    View Slide

  28. 28
    @WebEngDus
    Exercise

    View Slide

  29. 29
    @another_clue
    @WebEngDus
    Exercise

    View Slide

  30. 30
    @clue
    @another_clue
    @WebEngDus
    Exercise

    View Slide

  31. 31
    @clue
    @another_clue
    @WebEngDus
    @graphp
    Exercise

    View Slide

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

    View Slide

  33. More…
    33

    View Slide

  34. static analysis
    34

    View Slide

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

    View Slide

  36. static analysis
    digraph
    remove vertices with indegree=0
    36

    View Slide