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...
| Autor: | |
|---|---|
| Tipo de recurso: | artículo |
| Fecha de publicación: | 2022 |
| País: | España |
| Institución: | Universitat Politècnica de Catalunya (UPC) |
| Repositorio: | UPCommons. Portal del coneixement obert de la UPC |
| Idioma: | inglés |
| OAI Identifier: | oai:upcommons.upc.edu:2117/369749 |
| Acceso en línea: | https://hdl.handle.net/2117/369749 https://dx.doi.org/10.3390/a15020067 |
| Access Level: | acceso abierto |
| Palabra clave: | Graph algorithms Graph theory Computer science -- Mathematics Discrete mathematics Performance and testing of algorithms Adjacency matrices Adjacency lists Adjacency maps Algorismes de grafs Grafs, Teoria de Informàtica -- Matemàtica Àrees temàtiques de la UPC::Informàtica::Informàtica teòrica::Algorísmica i teoria de la complexitat |
| Sumario: | 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. |
|---|