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

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

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/