SlideShare a Scribd company logo
1 of 11
TOPIC NAME- BRIEF RELETIONSHIP BETWEEN
ADJACENCY MATRIX AND LIST
In graph theory, an adjacency matrix is nothing but a square matrix utilized to describe
a finite graph. The components of the matrix express whether the pairs of a finite set
of vertices (also called nodes) are adjacent in the graph or not. In graph
representation, the networks are expressed with the help of nodes and edges, where
nodes are the vertices and edges are the finite set of ordered pairs .
ADJENCY MATRIX
In graph theory and computer science an adjacency list is a collection of unordered lists used to
represent a finite graph. Each unordered list within an adjacency list describes the set of
neighbors of a particular vertex in the graph. This is one of several commonly used
representations of graphs for use in computer programs.
ADJACENCY LIST
PROPERTIES OF ADJACENCY MATRIX
The vertex matrix is an array of numbers
which is used to represent the information
about the graph. Some of the properties of
the graph correspond to the properties of
the adjacency matrix, and vice versa.
PROPERTIES OF ADJACENCY LIST
1)It is a finite graph.
2) a particular vertex in the graph .
DIFFERENCES BETWEEN ADJACENCY MATRIX AND ADJACENCY LIST
Operations Adjacency Matrix Adjacency List
Storage Space
This representation makes use of VxV
matrix, so space required in worst case
is O(|V|2).
In this representation, for every vertex we
store its neighbours. In the worst case, if a
graph is connected O(V) is required for a
vertex and O(E) is required for storing
neighbours corresponding to every vertex
.Thus, overall space complexity is
O(|V|+|E|).
Adding a vertex
In order to add a new vertex to VxV matrix
the storage must be increases to (|V|+1)2.
To achieve this we need to copy the whole
matrix. Therefore the complexity is O(|V|2).
There are two pointers in adjacency list first
points to the front node and the other one
points to the rear node.Thus insertion of a
vertex can be done directly in O(1) time.
Adding an edge
To add an edge say from i to j, matrix[i][j] =
1 which requires O(1) time.
Similar to insertion of vertex here also two
pointers are used pointing to the rear and
front of the list. Thus, an edge can be
inserted in O(1)time.
Removing a vertex
In order to remove a vertex from V*V matrix
the storage must be decreased to |V|2 from
(|V|+1)2. To achieve this we need to copy
the whole matrix. Therefore the complexity
is O(|V|2).
In order to remove a vertex, we need to
search for the vertex which will require
O(|V|) time in worst case, after this we
need to traverse the edges and in worst case
it will require O(|E|) time.Hence, total time
complexity is O(|V|+|E|).
APPLICATION OF ADJACENCY MATRIX
The adjacency matrix is a matrix used to represent
finite graphs. The values in the matrix show
whether pairs of nodes are adjacent to each other
in the graph structure. If the graph is undirected,
then the adjacency matrix will be a symmetric one.
APPLICATION OF ADJACENCY LIST
In graph theory and computer science, an adjacency list
is a collection of unordered lists used to represent a
finite graph. Each unordered list within an adjacency list
describes the set of neighbors of a particular vertex in
the graph.
THE RELATIONSHIP BETWEEN ADJACENCY LIST AND ADJACENCY MATRIX
If a graph has n number of vertices, then the adjacency matrix of
that graph is n x n, and each entry of the matrix represents the
number of edges from one vertex to another. An adjacency matrix
is also called as connection matrix. Sometimes it is also called a
Vertex matrix.
CONCLUSION
• Adjacency matrix is good for dense
graphs.
• Adjecency lists is good for sparse
graphs and also for changing the no
of nodes.
BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx

More Related Content

What's hot

Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
taimurkhan803
 
Graph representation
Graph representationGraph representation
Graph representation
Tech_MX
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
Sajid Marwat
 

What's hot (20)

Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtapADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
ADVANCE DATABASE MANAGEMENT SYSTEM CONCEPTS & ARCHITECTURE by vikas jagtap
 
Binary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of AlgorithmsBinary Search - Design & Analysis of Algorithms
Binary Search - Design & Analysis of Algorithms
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
 
UMTS, Introduction.
UMTS, Introduction.UMTS, Introduction.
UMTS, Introduction.
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
Ch 20 UNICAST ROUTING SECTION 2
Ch 20   UNICAST ROUTING  SECTION  2Ch 20   UNICAST ROUTING  SECTION  2
Ch 20 UNICAST ROUTING SECTION 2
 
Graph representation
Graph representationGraph representation
Graph representation
 
4.2 spatial data mining
4.2 spatial data mining4.2 spatial data mining
4.2 spatial data mining
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
 
Clustering: Large Databases in data mining
Clustering: Large Databases in data miningClustering: Large Databases in data mining
Clustering: Large Databases in data mining
 
Spatial databases
Spatial databasesSpatial databases
Spatial databases
 
Destination Sequenced Distance Vector Routing (DSDV)
Destination Sequenced Distance Vector Routing (DSDV)Destination Sequenced Distance Vector Routing (DSDV)
Destination Sequenced Distance Vector Routing (DSDV)
 
1.5 binary search tree
1.5 binary search tree1.5 binary search tree
1.5 binary search tree
 
Dijkstra
DijkstraDijkstra
Dijkstra
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
Red black trees
Red black treesRed black trees
Red black trees
 
Spatial Database
Spatial DatabaseSpatial Database
Spatial Database
 
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
 

Similar to BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx

Adjacency list
Adjacency listAdjacency list
Adjacency list
Stefi Yu
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
Victor Palmar
 
On algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetryOn algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetry
graphhoc
 

Similar to BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx (20)

Representation of graph.pptx
Representation of graph.pptxRepresentation of graph.pptx
Representation of graph.pptx
 
adjacencylist-130803205210-phpapp02 (1).pdf
adjacencylist-130803205210-phpapp02 (1).pdfadjacencylist-130803205210-phpapp02 (1).pdf
adjacencylist-130803205210-phpapp02 (1).pdf
 
Adjacency list
Adjacency listAdjacency list
Adjacency list
 
Lecture 5b graphs and hashing
Lecture 5b graphs and hashingLecture 5b graphs and hashing
Lecture 5b graphs and hashing
 
Graphs.ppt
Graphs.pptGraphs.ppt
Graphs.ppt
 
Graphs.ppt of mathemaics we have to clar all doubts
Graphs.ppt of mathemaics  we have to clar all doubtsGraphs.ppt of mathemaics  we have to clar all doubts
Graphs.ppt of mathemaics we have to clar all doubts
 
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATIONFREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
FREQUENT SUBGRAPH MINING ALGORITHMS - A SURVEY AND FRAMEWORK FOR CLASSIFICATION
 
On algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetryOn algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetry
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Graphs data structures
Graphs data structuresGraphs data structures
Graphs data structures
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
Graph
GraphGraph
Graph
 
NON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptxNON-LINEAR DATA STRUCTURE-Graphs.pptx
NON-LINEAR DATA STRUCTURE-Graphs.pptx
 
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRYON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 
data structures and algorithms Unit 2
data structures and algorithms Unit 2data structures and algorithms Unit 2
data structures and algorithms Unit 2
 
Graphs
GraphsGraphs
Graphs
 
graphs presentation .pptx
graphs presentation .pptxgraphs presentation .pptx
graphs presentation .pptx
 
Semantic Data Management in Graph Databases
Semantic Data Management in Graph DatabasesSemantic Data Management in Graph Databases
Semantic Data Management in Graph Databases
 
GRAPH MATRIX APPLICATIONS.pdf
GRAPH MATRIX APPLICATIONS.pdfGRAPH MATRIX APPLICATIONS.pdf
GRAPH MATRIX APPLICATIONS.pdf
 

More from CHIRANTANMONDAL2

More from CHIRANTANMONDAL2 (20)

eukaryotik dna elongation.pptx
eukaryotik dna elongation.pptxeukaryotik dna elongation.pptx
eukaryotik dna elongation.pptx
 
DNA IS GENETIC METERIAL.pptx
DNA IS GENETIC METERIAL.pptxDNA IS GENETIC METERIAL.pptx
DNA IS GENETIC METERIAL.pptx
 
DNA IS GENETIC MATERIAL(Experimental Proof).pptx
DNA IS GENETIC MATERIAL(Experimental Proof).pptxDNA IS GENETIC MATERIAL(Experimental Proof).pptx
DNA IS GENETIC MATERIAL(Experimental Proof).pptx
 
DNA Repair Mechanism And Their Types .pptx
DNA Repair Mechanism And Their Types .pptxDNA Repair Mechanism And Their Types .pptx
DNA Repair Mechanism And Their Types .pptx
 
DNA REPAIR MECHANISM AND THEIR TYPES.pptx
DNA REPAIR MECHANISM AND THEIR TYPES.pptxDNA REPAIR MECHANISM AND THEIR TYPES.pptx
DNA REPAIR MECHANISM AND THEIR TYPES.pptx
 
DNA STRUCTURE AND TYPES .pptx
DNA STRUCTURE AND TYPES .pptxDNA STRUCTURE AND TYPES .pptx
DNA STRUCTURE AND TYPES .pptx
 
TOPIC- DIFFERENT TYPES OF RNA, THEIR SYNTHESIS AND STRUCTURE.pptx
TOPIC- DIFFERENT TYPES OF RNA, THEIR SYNTHESIS AND STRUCTURE.pptxTOPIC- DIFFERENT TYPES OF RNA, THEIR SYNTHESIS AND STRUCTURE.pptx
TOPIC- DIFFERENT TYPES OF RNA, THEIR SYNTHESIS AND STRUCTURE.pptx
 
PROKARYOTS DNA REPLICATION.pptx
PROKARYOTS DNA REPLICATION.pptxPROKARYOTS DNA REPLICATION.pptx
PROKARYOTS DNA REPLICATION.pptx
 
Lac Operon System(Catabolite Repression).pptx
Lac Operon System(Catabolite Repression).pptxLac Operon System(Catabolite Repression).pptx
Lac Operon System(Catabolite Repression).pptx
 
DNA POLYMERASE.pptx
DNA POLYMERASE.pptxDNA POLYMERASE.pptx
DNA POLYMERASE.pptx
 
DNA POLYMERASE AND RNA POLYMERASE.pptx
DNA POLYMERASE AND RNA POLYMERASE.pptxDNA POLYMERASE AND RNA POLYMERASE.pptx
DNA POLYMERASE AND RNA POLYMERASE.pptx
 
PROKARYOTES DNA RPLICATION.pptx
PROKARYOTES DNA RPLICATION.pptxPROKARYOTES DNA RPLICATION.pptx
PROKARYOTES DNA RPLICATION.pptx
 
PROKARYOTIC DNA REPLICATION .pptx
PROKARYOTIC DNA REPLICATION .pptxPROKARYOTIC DNA REPLICATION .pptx
PROKARYOTIC DNA REPLICATION .pptx
 
Prokaryotic DNA replication.pptx
Prokaryotic DNA replication.pptxProkaryotic DNA replication.pptx
Prokaryotic DNA replication.pptx
 
DNA repair mechanism and their types.pptx
DNA repair mechanism and their types.pptxDNA repair mechanism and their types.pptx
DNA repair mechanism and their types.pptx
 
TOPIC NAME Structure of DNA and their Type.pptx
TOPIC NAME  Structure of DNA and their Type.pptxTOPIC NAME  Structure of DNA and their Type.pptx
TOPIC NAME Structure of DNA and their Type.pptx
 
LAC OPERON SYSTEM.pptx
LAC  OPERON  SYSTEM.pptxLAC  OPERON  SYSTEM.pptx
LAC OPERON SYSTEM.pptx
 
LAC OPERON 2.pptx
LAC  OPERON 2.pptxLAC  OPERON 2.pptx
LAC OPERON 2.pptx
 
DNA STRUCTURE AND TYPES.pptx
DNA STRUCTURE AND TYPES.pptxDNA STRUCTURE AND TYPES.pptx
DNA STRUCTURE AND TYPES.pptx
 
TOPIC-DNA repair mechanism and their types.pptx
TOPIC-DNA repair mechanism and their types.pptxTOPIC-DNA repair mechanism and their types.pptx
TOPIC-DNA repair mechanism and their types.pptx
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 

BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST.pptx

  • 1. TOPIC NAME- BRIEF RELETIONSHIP BETWEEN ADJACENCY MATRIX AND LIST
  • 2. In graph theory, an adjacency matrix is nothing but a square matrix utilized to describe a finite graph. The components of the matrix express whether the pairs of a finite set of vertices (also called nodes) are adjacent in the graph or not. In graph representation, the networks are expressed with the help of nodes and edges, where nodes are the vertices and edges are the finite set of ordered pairs . ADJENCY MATRIX
  • 3. In graph theory and computer science an adjacency list is a collection of unordered lists used to represent a finite graph. Each unordered list within an adjacency list describes the set of neighbors of a particular vertex in the graph. This is one of several commonly used representations of graphs for use in computer programs. ADJACENCY LIST
  • 4. PROPERTIES OF ADJACENCY MATRIX The vertex matrix is an array of numbers which is used to represent the information about the graph. Some of the properties of the graph correspond to the properties of the adjacency matrix, and vice versa.
  • 5. PROPERTIES OF ADJACENCY LIST 1)It is a finite graph. 2) a particular vertex in the graph .
  • 6. DIFFERENCES BETWEEN ADJACENCY MATRIX AND ADJACENCY LIST Operations Adjacency Matrix Adjacency List Storage Space This representation makes use of VxV matrix, so space required in worst case is O(|V|2). In this representation, for every vertex we store its neighbours. In the worst case, if a graph is connected O(V) is required for a vertex and O(E) is required for storing neighbours corresponding to every vertex .Thus, overall space complexity is O(|V|+|E|). Adding a vertex In order to add a new vertex to VxV matrix the storage must be increases to (|V|+1)2. To achieve this we need to copy the whole matrix. Therefore the complexity is O(|V|2). There are two pointers in adjacency list first points to the front node and the other one points to the rear node.Thus insertion of a vertex can be done directly in O(1) time. Adding an edge To add an edge say from i to j, matrix[i][j] = 1 which requires O(1) time. Similar to insertion of vertex here also two pointers are used pointing to the rear and front of the list. Thus, an edge can be inserted in O(1)time. Removing a vertex In order to remove a vertex from V*V matrix the storage must be decreased to |V|2 from (|V|+1)2. To achieve this we need to copy the whole matrix. Therefore the complexity is O(|V|2). In order to remove a vertex, we need to search for the vertex which will require O(|V|) time in worst case, after this we need to traverse the edges and in worst case it will require O(|E|) time.Hence, total time complexity is O(|V|+|E|).
  • 7. APPLICATION OF ADJACENCY MATRIX The adjacency matrix is a matrix used to represent finite graphs. The values in the matrix show whether pairs of nodes are adjacent to each other in the graph structure. If the graph is undirected, then the adjacency matrix will be a symmetric one.
  • 8. APPLICATION OF ADJACENCY LIST In graph theory and computer science, an adjacency list is a collection of unordered lists used to represent a finite graph. Each unordered list within an adjacency list describes the set of neighbors of a particular vertex in the graph.
  • 9. THE RELATIONSHIP BETWEEN ADJACENCY LIST AND ADJACENCY MATRIX If a graph has n number of vertices, then the adjacency matrix of that graph is n x n, and each entry of the matrix represents the number of edges from one vertex to another. An adjacency matrix is also called as connection matrix. Sometimes it is also called a Vertex matrix.
  • 10. CONCLUSION • Adjacency matrix is good for dense graphs. • Adjecency lists is good for sparse graphs and also for changing the no of nodes.