Adjacency Maps and Efficient Graph Algorithms

Graph algorithms that test adjacencies are usually implemented with an adjacency-matrix representation because the adjacency test takes constant time with adjacency matrices, but it takes linear time in the degree of the vertices with adjacency lists. In this article, we review the adjacency-map rep...

Full description

Bibliographic Details
Main Author: Gabriel Valiente
Format: Article
Language:English
Published: MDPI AG 2022-02-01
Series:Algorithms
Subjects:
Online Access:https://www.mdpi.com/1999-4893/15/2/67
Description
Summary:Graph algorithms that test adjacencies are usually implemented with an adjacency-matrix representation because the adjacency test takes constant time with adjacency matrices, but it takes linear time in the degree of the vertices with adjacency lists. In this article, we review the adjacency-map representation, which supports adjacency tests in constant expected time, and we show that graph algorithms run faster with adjacency maps than with adjacency lists by a small constant factor if they do not test adjacencies and by one or two orders of magnitude if they perform adjacency tests.
ISSN:1999-4893