SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
Graphs



         www.tudorgirba.com
G = (V, E)
E = { {u,v} | u,v ∈ V}

 a                       e




           c         d       g



 b                       f
G = (V, E)
E = { {u,v} | u,v ∈ V}

  a                                      e




               c              d                      g



  b                                      f



V = { a, b, c, d, e, f, g }

E = { {a,b}, {a,c}, {b,c}, {c,d}, {d,e}, {d,f}, {e,g}, {f,g} }
G = (V, E)
E = { {u,v} | u,v ∈ V}

  a                                      e




               c              d                      g



  b                                      f



V = { a, b, c, d, e, f, g }

E = { {a,b}, {a,c}, {b,c}, {c,d}, {d,e}, {d,f}, {e,g}, {f,g} }
a   b   c   d   e   f   g

a   0   1   1   0   0   0   0

b   0   0   1   0   0   0   0   a           e
c   0   0   0   1   0   0   0
                                    c   d       g
d   0   0   0   0   1   1   0

e   0   0   0   0   0   0   1   b           f

f   0   0   0   0   0   0   1

g   0   0   0   0   0   0   0
a   b   c   d   e   f   g

a   0   1   1   0   0   0   0

b   1   0   1   0   0   0   0   a           e
c   1   1   0   1   0   0   0
                                    c   d       g
d   0   0   1   0   1   1   0

e   0   0   0   1   0   0   1   b           f

f   0   0   0   1   0   0   1

g   0   0   0   0   1   1   0
a   b   c   d   e   f   g

a   0   1   1   0   0   0   0   2                 2
b   1   0   1   0   0   0   0   a                 e
c   1   1   0   1   0   0   0
                                    c      d           g
d   0   0   1   0   1   1   0
                                    3      3           2
e   0   0   0   1   0   0   1   b                 f

f   0   0   0   1   0   0   1                     2

g   0   0   0   0   1   1   0

    2   2   3   3   2   2   2       Degree of a node
a   b   c   d   e   f   g

a   0   2   3   0   0   0   0

b   0   0   1   0   0   0   0   a                       e
                                    3               5       3
c   0   0   0   2   0   0   0               2
                                2       c       d               g
d   0   0   0   0   5   4   0
                                    1               4       3
e   0   0   0   0   0   0   3   b                       f

f   0   0   0   0   0   0   3

g   0   0   0   0   0   0   0


                                        Weighted graphs
Not complete   Complete

  a            a

        c            c

  b            b


  a            a

        c            c

  b            b
G = (V, E)
∀ e={v,w} ∈ E, v ∈ V and w ∈ W.



    Bipartite                     Not bipartite
Path                       Cycle

     a                         e

             c        d                 g

     b                         f



Path: (b, a, c); Length (b, a, c) = 2
Path: (b, d, f)
Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
Path                       Cycle

     a                         e

             c        d                 g

     b                         f



Path: (b, a, c); Length (b, a, c) = 2
Path: (b, d, f)
Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
Path                       Cycle

     a                         e

             c        d                 g

     b                         f



Path: (b, a, c); Length (b, a, c) = 2
Path: (b, d, f)
Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
Loop-free                   Loop


a                   e       a              e

    c      d            g       c    d         g

b                   f       b              f
a           e

    c   d       g

b           f
Eulerian path


a           e       a                   e

    c   d       g       c     d             g

b           f       b                   f
Hamiltonian path           Eulerian path


a                  e       a                   e

     c      d          g       c     d             g

b                  f       b                   f
Spanning tree               Components

                                    e
a                   e

                            d                g
     c      d           g

                                    f
b                   f

                            a
     G = (V, E).
     T ⊆ E.                         c
a   Critical node   e

    c          d        g

b   Critical edge   f
Biconnected components

a                    e

     c         d         g

b                    f
G = (V, E)
G1 = (V1, E1)
E1 = {{u,v}∈ E | u,v ∈ V1} ⊆ E.



            a                         e

Subgraph            c             d       g   Not subgraph

            b                         f
Weakly reachable = exists undirected path



     a                     e

            c      d              g

     b                     f



Strongly reachable = exists directed path
9           F
                  E
                                                     6
                            2
                                          11             D
             14                     C
                        9
                                                15
                                    10
               A
                            7               B
                                                                           ithm
                                                          i  jkstr a algor
                                            Exa mple: D
http://scg.unibe.ch/download/lectures/ei/01ComputationalThinking.pptx
9         F
     E
                                    6
             2
                          11            D
14                   C
         9
                               15
                     10
 A
             7             B
                                                          ithm
                                     i      jkstr a algor
                          Exa mple: D
∞
                     9         F
∞        E
                                            6
                 2                                   ∞
                     ∞
                              11                D
    14                   C
             9
                                   15
                         10
0
     A
                 7             B        ∞
                                                                  ithm
                                         i          jkstr a algor
                              Exa mple: D
∞
                     9         F
14       E
                                            6
                 2                                   ∞
                         9
                              11                D
    14                   C
             9
                                   15
                         10
0
     A
                 7             B        7
                                                                  ithm
                                         i          jkstr a algor
                              Exa mple: D
∞
                     9             F
14       E
                                                6
                 2                                        7 + 15 = 22
                         9 < 7 + 10
                                  11                D
    14                   C
             9
                                       15
                         10
0
     A
                 7                B         7
                                                                      ithm
                                             i          jkstr a algor
                                  Exa mple: D
∞
                           9         F
14 > 9 + 2     E
                                                  6
                       2                                   22 > 9 + 11
                               9
                                    11                D
          14                   C
                   9
                                         15
                               10
      0
             A
                       7             B        7
                                                                        ithm
                                               i          jkstr a algor
                                    Exa mple: D
20
                      9         F
11        E
                                             6
                  2                                    20
                          9
                               11                D
     14                   C
              9
                                    15
                          10
0
      A
                  7             B        7
                                                                   ithm
                                          i          jkstr a algor
                               Exa mple: D
20 < 20 + 6
                      9         F
11        E
                                             6
                  2                                    20
                          9
                               11                D
     14                   C
              9
                                    15
                          10
0
      A
                  7             B        7
                                                                   ithm
                                          i          jkstr a algor
                               Exa mple: D
a b c d e f g
                                    a 0 2 3 0 0 0 0
a                       e           b 0 0 1 0 0 0 0
    3               5       3
            2                       c 0 0 0 2 0 0 0
2       c       d               g
                                    d 0 0 0 0 5 4 0
    1               4       3       e 0 0 0 0 0 0 3
b                       f
                                    f 0 0 0 0 0 0 3
                                    g 0 0 0 0 0 0 0




                                                     Warshall
                                             : Floyd
                                     Example
a b c d e f g
                                        a 0 2 3 0 0 0 0
 a                       e              b 0 0 1 0 0 0 0
     3               5       3
             2                          c 0 0 0 2 0 0 0
2        c       d               g
                                        d 0 0 0 0 5 4 0
     1               4       3          e 0 0 0 0 0 0 3
 b                       f
                                        f 0 0 0 0 0 0 3
                                        g 0 0 0 0 0 0 0

procedure FloydWarshall ()
   for k := 1 to n
       for i := 1 to n
          for j := 1 to n
             path[i][j] = min ( path[i][j], path[i][k]+path[k][j] );


                                                           Warshall
                                                   : Floyd
                                          E xample
ing sa lesman
                l
        : Trave
Example
Tudor Gîrba
        www.tudorgirba.com




creativecommons.org/licenses/by/3.0/

Mais conteúdo relacionado

Semelhante a Graph Theory Concepts Explained

Semelhante a Graph Theory Concepts Explained (20)

Taocp 2.3
Taocp 2.3Taocp 2.3
Taocp 2.3
 
Graph
GraphGraph
Graph
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Gabarito vestibular
Gabarito vestibularGabarito vestibular
Gabarito vestibular
 
Ph2100 exam answers
Ph2100 exam answersPh2100 exam answers
Ph2100 exam answers
 
Discrete maths assignment
Discrete maths assignmentDiscrete maths assignment
Discrete maths assignment
 
Worked examples projects unit 1
Worked examples projects unit 1Worked examples projects unit 1
Worked examples projects unit 1
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of Graph
 
Gabaritos ok
Gabaritos okGabaritos ok
Gabaritos ok
 
Csr2011 june16 12_00_wagner
Csr2011 june16 12_00_wagnerCsr2011 june16 12_00_wagner
Csr2011 june16 12_00_wagner
 
XXL Graph Algorithms__HadoopSummit2010
XXL Graph Algorithms__HadoopSummit2010XXL Graph Algorithms__HadoopSummit2010
XXL Graph Algorithms__HadoopSummit2010
 
Graphs
GraphsGraphs
Graphs
 
Ficha trab solidos1 resolução
Ficha trab solidos1 resoluçãoFicha trab solidos1 resolução
Ficha trab solidos1 resolução
 
Claves guias
Claves guiasClaves guias
Claves guias
 
Bndes0109 tecnico
Bndes0109 tecnicoBndes0109 tecnico
Bndes0109 tecnico
 
graph.pptx
graph.pptxgraph.pptx
graph.pptx
 
Gabaritos Pebii
Gabaritos PebiiGabaritos Pebii
Gabaritos Pebii
 
Ca8e Ppt 6 1
Ca8e Ppt 6 1Ca8e Ppt 6 1
Ca8e Ppt 6 1
 

Mais de Tudor Girba

Beyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismBeyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismTudor Girba
 
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Tudor Girba
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Tudor Girba
 
Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Tudor Girba
 
Humane assessment on cards
Humane assessment on cardsHumane assessment on cards
Humane assessment on cardsTudor Girba
 
Underneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingUnderneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingTudor Girba
 
1800+ TED talks later
1800+ TED talks later1800+ TED talks later
1800+ TED talks laterTudor Girba
 
Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Tudor Girba
 
Humane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomHumane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomTudor Girba
 
Moose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeMoose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeTudor Girba
 
Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Tudor Girba
 
The emergent nature of software systems
The emergent nature of software systemsThe emergent nature of software systems
The emergent nature of software systemsTudor Girba
 
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Tudor Girba
 
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Tudor Girba
 
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Tudor Girba
 
Demo-driven innovation teaser
Demo-driven innovation teaserDemo-driven innovation teaser
Demo-driven innovation teaserTudor Girba
 
Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Tudor Girba
 
Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Tudor Girba
 
Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Tudor Girba
 

Mais de Tudor Girba (20)

Beyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalismBeyond software evolution: Software environmentalism
Beyond software evolution: Software environmentalism
 
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
Software craftsmanship meetup (Zurich 2015) on solving real problems without ...
 
GT Spotter
GT SpotterGT Spotter
GT Spotter
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)
 
Don't demo facts. Demo stories!
Don't demo facts. Demo stories!Don't demo facts. Demo stories!
Don't demo facts. Demo stories!
 
Humane assessment on cards
Humane assessment on cardsHumane assessment on cards
Humane assessment on cards
 
Underneath Scrum: Reflective Thinking
Underneath Scrum: Reflective ThinkingUnderneath Scrum: Reflective Thinking
Underneath Scrum: Reflective Thinking
 
1800+ TED talks later
1800+ TED talks later1800+ TED talks later
1800+ TED talks later
 
Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)Software assessment by example (lecture at the University of Bern)
Software assessment by example (lecture at the University of Bern)
 
Humane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development roomHumane assessment: Taming the elephant from the development room
Humane assessment: Taming the elephant from the development room
 
Moose: how to solve real problems without reading code
Moose: how to solve real problems without reading codeMoose: how to solve real problems without reading code
Moose: how to solve real problems without reading code
 
Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)Software Environmentalism (ECOOP 2014 Keynote)
Software Environmentalism (ECOOP 2014 Keynote)
 
The emergent nature of software systems
The emergent nature of software systemsThe emergent nature of software systems
The emergent nature of software systems
 
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)Presenting is storytelling at Uni Zurich - slides (2014-03-05)
Presenting is storytelling at Uni Zurich - slides (2014-03-05)
 
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
Presenting is storytelling at Uni Zurich - handouts (2014-03-05)
 
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
Underneath Scrum: Reflective Thinking (talk at Scrum Breakfast Bern, 2013)
 
Demo-driven innovation teaser
Demo-driven innovation teaserDemo-driven innovation teaser
Demo-driven innovation teaser
 
Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)Software assessment essentials (lecture at the University of Bern 2013)
Software assessment essentials (lecture at the University of Bern 2013)
 
Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)Demo-driven innovation (University of Zurich, June 2013)
Demo-driven innovation (University of Zurich, June 2013)
 
Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011Humane assessment with Moose at GOTO Aarhus 2011
Humane assessment with Moose at GOTO Aarhus 2011
 

Último

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Último (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Graph Theory Concepts Explained

  • 1. Graphs www.tudorgirba.com
  • 2.
  • 3.
  • 4.
  • 5. G = (V, E) E = { {u,v} | u,v ∈ V} a e c d g b f
  • 6. G = (V, E) E = { {u,v} | u,v ∈ V} a e c d g b f V = { a, b, c, d, e, f, g } E = { {a,b}, {a,c}, {b,c}, {c,d}, {d,e}, {d,f}, {e,g}, {f,g} }
  • 7. G = (V, E) E = { {u,v} | u,v ∈ V} a e c d g b f V = { a, b, c, d, e, f, g } E = { {a,b}, {a,c}, {b,c}, {c,d}, {d,e}, {d,f}, {e,g}, {f,g} }
  • 8. a b c d e f g a 0 1 1 0 0 0 0 b 0 0 1 0 0 0 0 a e c 0 0 0 1 0 0 0 c d g d 0 0 0 0 1 1 0 e 0 0 0 0 0 0 1 b f f 0 0 0 0 0 0 1 g 0 0 0 0 0 0 0
  • 9. a b c d e f g a 0 1 1 0 0 0 0 b 1 0 1 0 0 0 0 a e c 1 1 0 1 0 0 0 c d g d 0 0 1 0 1 1 0 e 0 0 0 1 0 0 1 b f f 0 0 0 1 0 0 1 g 0 0 0 0 1 1 0
  • 10. a b c d e f g a 0 1 1 0 0 0 0 2 2 b 1 0 1 0 0 0 0 a e c 1 1 0 1 0 0 0 c d g d 0 0 1 0 1 1 0 3 3 2 e 0 0 0 1 0 0 1 b f f 0 0 0 1 0 0 1 2 g 0 0 0 0 1 1 0 2 2 3 3 2 2 2 Degree of a node
  • 11. a b c d e f g a 0 2 3 0 0 0 0 b 0 0 1 0 0 0 0 a e 3 5 3 c 0 0 0 2 0 0 0 2 2 c d g d 0 0 0 0 5 4 0 1 4 3 e 0 0 0 0 0 0 3 b f f 0 0 0 0 0 0 3 g 0 0 0 0 0 0 0 Weighted graphs
  • 12. Not complete Complete a a c c b b a a c c b b
  • 13. G = (V, E) ∀ e={v,w} ∈ E, v ∈ V and w ∈ W. Bipartite Not bipartite
  • 14. Path Cycle a e c d g b f Path: (b, a, c); Length (b, a, c) = 2 Path: (b, d, f) Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
  • 15. Path Cycle a e c d g b f Path: (b, a, c); Length (b, a, c) = 2 Path: (b, d, f) Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
  • 16. Path Cycle a e c d g b f Path: (b, a, c); Length (b, a, c) = 2 Path: (b, d, f) Cycle: (f, g, e, d, f); Length (f, g, e, d, f) = 4
  • 17. Loop-free Loop a e a e c d g c d g b f b f
  • 18. a e c d g b f
  • 19. Eulerian path a e a e c d g c d g b f b f
  • 20. Hamiltonian path Eulerian path a e a e c d g c d g b f b f
  • 21. Spanning tree Components e a e d g c d g f b f a G = (V, E). T ⊆ E. c
  • 22. a Critical node e c d g b Critical edge f
  • 24. G = (V, E) G1 = (V1, E1) E1 = {{u,v}∈ E | u,v ∈ V1} ⊆ E. a e Subgraph c d g Not subgraph b f
  • 25. Weakly reachable = exists undirected path a e c d g b f Strongly reachable = exists directed path
  • 26. 9 F E 6 2 11 D 14 C 9 15 10 A 7 B ithm i jkstr a algor Exa mple: D http://scg.unibe.ch/download/lectures/ei/01ComputationalThinking.pptx
  • 27. 9 F E 6 2 11 D 14 C 9 15 10 A 7 B ithm i jkstr a algor Exa mple: D
  • 28. 9 F ∞ E 6 2 ∞ ∞ 11 D 14 C 9 15 10 0 A 7 B ∞ ithm i jkstr a algor Exa mple: D
  • 29. 9 F 14 E 6 2 ∞ 9 11 D 14 C 9 15 10 0 A 7 B 7 ithm i jkstr a algor Exa mple: D
  • 30. 9 F 14 E 6 2 7 + 15 = 22 9 < 7 + 10 11 D 14 C 9 15 10 0 A 7 B 7 ithm i jkstr a algor Exa mple: D
  • 31. 9 F 14 > 9 + 2 E 6 2 22 > 9 + 11 9 11 D 14 C 9 15 10 0 A 7 B 7 ithm i jkstr a algor Exa mple: D
  • 32. 20 9 F 11 E 6 2 20 9 11 D 14 C 9 15 10 0 A 7 B 7 ithm i jkstr a algor Exa mple: D
  • 33. 20 < 20 + 6 9 F 11 E 6 2 20 9 11 D 14 C 9 15 10 0 A 7 B 7 ithm i jkstr a algor Exa mple: D
  • 34. a b c d e f g a 0 2 3 0 0 0 0 a e b 0 0 1 0 0 0 0 3 5 3 2 c 0 0 0 2 0 0 0 2 c d g d 0 0 0 0 5 4 0 1 4 3 e 0 0 0 0 0 0 3 b f f 0 0 0 0 0 0 3 g 0 0 0 0 0 0 0 Warshall : Floyd Example
  • 35. a b c d e f g a 0 2 3 0 0 0 0 a e b 0 0 1 0 0 0 0 3 5 3 2 c 0 0 0 2 0 0 0 2 c d g d 0 0 0 0 5 4 0 1 4 3 e 0 0 0 0 0 0 3 b f f 0 0 0 0 0 0 3 g 0 0 0 0 0 0 0 procedure FloydWarshall () for k := 1 to n for i := 1 to n for j := 1 to n path[i][j] = min ( path[i][j], path[i][k]+path[k][j] ); Warshall : Floyd E xample
  • 36. ing sa lesman l : Trave Example
  • 37. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/