SlideShare a Scribd company logo
1 of 14
CSE 131: DISCRETE MATHEMATICS
MS. TASMIA TASRIN ( LECTURER )
Group: Enigma
H.M. Rafi Hasan (161-15-7050)
Mohammad Touhidul Islam (161-15-7051)
Md. Rahmat Ullah (161-15-6970)
Abir Hasnat (161-15-6789)
Alinewaz Chowdhory (161-15-6790)
PRESENTATION ON
Adjacency And Incidence Matrix
WHAT IS GRAPH?
Graph is a set of edges and vertices.
A B
C D
E
REPRESENTING OF GRAPHS
Graph can be represented in the form of matrix.
Different matrix that can be formed are:
1. Adjacency Matrix
2. Incidence Matrix
3. Cut-Set Matrix
4. Circuit Matrix
5. Path Matrix
Adjacency Matrix
Edge connected to the vertex is known as incidence edge to that vertex
 If vertex is connected to itself then vertex is said to be adjacent to itself.
If vertex is adjacent then put 1 else 0.
Undirected and directed adjacency matrix is different
a
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
0 00
0 01
1 01
1 01
1 10
0 10
0 10
0 11
0 00
0 02
2 1
0 01
0
V4 V6V5V1 V3V2
V1
V2
V3
V4
V5
V6
Vertices
Vertices
DIRECTED ADJACENCY MATRIX
V6
V4
V5V2
V3
h
ec
f
d
V1
a
b
0 00
0 01
0 01
1 00
1 10
0 00
0 10
0 00
0 00
0 01
1 1
0 00
0
V4 V6V5V1 V3V2
V1
V2
V3
V4
V5
V6
Vertices
Vertices
Incidence Matrix
Edge connected to the vertex is known as incidence edge to that vertex
If vertex is incident on vertex then put 1 else 0.
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
Vertex
V1
V2
V3
V4
V5
V6
Edges
a, b
a, b, c, f
c, d, g
d, e
d, e, f, g, h
h
0 00
0 10
1 01
1 010 00
1 01
1 1
0 10
1
d fea cb
V4
V1
V
2V3
g h
0
0
1
1
0
0
0
0
Edges
Vertex
1 11
0 000 00
0 00
V6
V5 1
0
1
1
APPLICATION OF INCIDENCE
AND ADJACENCY MATRIX
INCIDENCE TO ADJACENCY MATRIX
• int m = 4; // number or rows = number of cols
• double mat[m][m] = {
• {0, 1, 1, 1} , // first point adjacent to all others
• {1, 0, 0, 0} , // 2nd only adjacent to 1st
• {1, 0, 0, 1} , // 3rd adjacent to 1st & 4th
• {1, 0, 1, 0} // 4th adjacent to 1st & 3rd
• };
•
• for(int i=0; i<m-1;++i)
• {
• for(int j=i+1; j < m; ++i)
• { // loop through upper triangle
• if( math[i][j] )
• { // if element is set
• addPair(i,j); // add it to the list
• }
• }
• }
MAPPING
•Adjacency Lists and average time complexity
for binary search
SHORTEST PATH
GOOGLE SELF-DRIVING CAR

More Related Content

What's hot

Looping statements in C
Looping statements in CLooping statements in C
Looping statements in CJeya Lakshmi
 
Graph Traversal Algorithm
Graph Traversal AlgorithmGraph Traversal Algorithm
Graph Traversal Algorithmjyothimonc
 
Topological Sorting
Topological SortingTopological Sorting
Topological SortingShahDhruv21
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithmmansab MIRZA
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graphumair khan
 
Recurrence relations
Recurrence relationsRecurrence relations
Recurrence relationsIIUM
 
Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Traian Rebedea
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsNikhil Sharma
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2showslidedump
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Muhammad Hammad Waseem
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data StructureAnuj Modi
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 

What's hot (20)

Graph theory
Graph  theoryGraph  theory
Graph theory
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
Graph Traversal Algorithm
Graph Traversal AlgorithmGraph Traversal Algorithm
Graph Traversal Algorithm
 
Linked list
Linked listLinked list
Linked list
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
 
Topological Sorting
Topological SortingTopological Sorting
Topological Sorting
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
 
Recurrence relations
Recurrence relationsRecurrence relations
Recurrence relations
 
Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3Algorithm Design and Complexity - Course 3
Algorithm Design and Complexity - Course 3
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]Data Structures - Lecture 7 [Linked List]
Data Structures - Lecture 7 [Linked List]
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 

Viewers also liked

Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming LanguageJunji Zhi
 
Application of 1st Order ODE
Application of 1st Order ODEApplication of 1st Order ODE
Application of 1st Order ODEAbir Junayed
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentationtigerwarn
 
4. python functions
4. python   functions4. python   functions
4. python functionsin4400
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Cloud computing simple ppt
Cloud computing simple pptCloud computing simple ppt
Cloud computing simple pptAgarwaljay
 
Introduction of Cloud computing
Introduction of Cloud computingIntroduction of Cloud computing
Introduction of Cloud computingRkrishna Mishra
 

Viewers also liked (13)

Interface
InterfaceInterface
Interface
 
Interface Vs Abstact
Interface Vs AbstactInterface Vs Abstact
Interface Vs Abstact
 
Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Language
 
Application of 1st Order ODE
Application of 1st Order ODEApplication of 1st Order ODE
Application of 1st Order ODE
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentation
 
4. python functions
4. python   functions4. python   functions
4. python functions
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Cloud computing simple ppt
Cloud computing simple pptCloud computing simple ppt
Cloud computing simple ppt
 
Introduction of Cloud computing
Introduction of Cloud computingIntroduction of Cloud computing
Introduction of Cloud computing
 
cloud computing ppt
cloud computing pptcloud computing ppt
cloud computing ppt
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

More from Abir Junayed

Normalization DBMS
Normalization DBMSNormalization DBMS
Normalization DBMSAbir Junayed
 
Presentation on TCP/IP Model
Presentation on TCP/IP ModelPresentation on TCP/IP Model
Presentation on TCP/IP ModelAbir Junayed
 
Presentation on Core i9
Presentation on Core i9Presentation on Core i9
Presentation on Core i9Abir Junayed
 

More from Abir Junayed (6)

Linux file system
Linux file systemLinux file system
Linux file system
 
Normalization DBMS
Normalization DBMSNormalization DBMS
Normalization DBMS
 
Presentation on TCP/IP Model
Presentation on TCP/IP ModelPresentation on TCP/IP Model
Presentation on TCP/IP Model
 
Presentation on Core i9
Presentation on Core i9Presentation on Core i9
Presentation on Core i9
 
Tissue Culture
Tissue CultureTissue Culture
Tissue Culture
 
Why is 3G
Why is 3GWhy is 3G
Why is 3G
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Adjacency And Incidence Matrix

  • 1. CSE 131: DISCRETE MATHEMATICS MS. TASMIA TASRIN ( LECTURER ) Group: Enigma H.M. Rafi Hasan (161-15-7050) Mohammad Touhidul Islam (161-15-7051) Md. Rahmat Ullah (161-15-6970) Abir Hasnat (161-15-6789) Alinewaz Chowdhory (161-15-6790)
  • 2. PRESENTATION ON Adjacency And Incidence Matrix
  • 3. WHAT IS GRAPH? Graph is a set of edges and vertices. A B C D E
  • 4. REPRESENTING OF GRAPHS Graph can be represented in the form of matrix. Different matrix that can be formed are: 1. Adjacency Matrix 2. Incidence Matrix 3. Cut-Set Matrix 4. Circuit Matrix 5. Path Matrix
  • 5. Adjacency Matrix Edge connected to the vertex is known as incidence edge to that vertex  If vertex is connected to itself then vertex is said to be adjacent to itself. If vertex is adjacent then put 1 else 0. Undirected and directed adjacency matrix is different a V6 V4 V5V2 V3 h ec f d V1 a b 0 00 0 01 1 01 1 01 1 10 0 10 0 10 0 11 0 00 0 02 2 1 0 01 0 V4 V6V5V1 V3V2 V1 V2 V3 V4 V5 V6 Vertices Vertices
  • 6. DIRECTED ADJACENCY MATRIX V6 V4 V5V2 V3 h ec f d V1 a b 0 00 0 01 0 01 1 00 1 10 0 00 0 10 0 00 0 00 0 01 1 1 0 00 0 V4 V6V5V1 V3V2 V1 V2 V3 V4 V5 V6 Vertices Vertices
  • 7. Incidence Matrix Edge connected to the vertex is known as incidence edge to that vertex If vertex is incident on vertex then put 1 else 0. V6 V4 V5V2 V3 h ec f d V1 a b Vertex V1 V2 V3 V4 V5 V6 Edges a, b a, b, c, f c, d, g d, e d, e, f, g, h h 0 00 0 10 1 01 1 010 00 1 01 1 1 0 10 1 d fea cb V4 V1 V 2V3 g h 0 0 1 1 0 0 0 0 Edges Vertex 1 11 0 000 00 0 00 V6 V5 1 0 1 1
  • 8. APPLICATION OF INCIDENCE AND ADJACENCY MATRIX
  • 9. INCIDENCE TO ADJACENCY MATRIX • int m = 4; // number or rows = number of cols • double mat[m][m] = { • {0, 1, 1, 1} , // first point adjacent to all others • {1, 0, 0, 0} , // 2nd only adjacent to 1st • {1, 0, 0, 1} , // 3rd adjacent to 1st & 4th • {1, 0, 1, 0} // 4th adjacent to 1st & 3rd • }; • • for(int i=0; i<m-1;++i) • { • for(int j=i+1; j < m; ++i) • { // loop through upper triangle • if( math[i][j] ) • { // if element is set • addPair(i,j); // add it to the list • } • } • }
  • 11. •Adjacency Lists and average time complexity for binary search
  • 13.