Skip to main content
QUICK REVIEW

[Paper Review] Data structure for representing a graph: combination of linked list and hash table

Maxim A. Kolosovskiy|ArXiv.org|Aug 21, 2009
Graph Theory and Algorithms1 references3 citations
TL;DR

This paper proposes a hybrid graph data structure combining linked lists and hash tables to achieve O(1) average-case time for edge insertion and lookup, while maintaining O(V + E) memory usage and efficient adjacency list retrieval. The structure uses a hash table to index vertices and linked lists to store neighbors, balancing the performance of adjacency matrices with the space efficiency of adjacency lists.

ABSTRACT

In this article we discuss a data structure, which combines advantages of two different ways for representing graphs: adjacency matrix and collection of adjacency lists. This data structure can fast add and search edges (advantages of adjacency matrix), use linear amount of memory, let to obtain adjacency list for certain vertex (advantages of collection of adjacency lists). Basic knowledge of linked lists and hash tables is required to understand this article. The article contains examples of implementation on Java.

Motivation & Objective

  • To address the limitations of traditional graph representations like adjacency matrices (high memory) and adjacency lists (slow edge lookup).
  • To design a data structure that combines the fast edge lookup of adjacency matrices with the space efficiency of adjacency lists.
  • To enable efficient insertion, search, and traversal operations in dynamic graphs.
  • To provide a practical, implementable solution using standard data structures in Java.

Proposed method

  • Represent each vertex as a hash table entry mapping vertex ID to a linked list of adjacent vertices.
  • Use a hash table to store vertex mappings, enabling O(1) average-case access to any vertex's adjacency list.
  • Store each adjacency list as a singly linked list to allow efficient insertion and traversal of neighbors.
  • Maintain a global structure that maps vertex identifiers to their respective linked list heads via the hash table.
  • Support operations such as addEdge, hasEdge, and getNeighbors using the hash table for indexing and linked lists for iteration.
  • Ensure memory usage remains linear in the number of vertices and edges (O(V + E)) by avoiding redundant storage.

Experimental results

Research questions

  • RQ1Can a hybrid data structure achieve fast edge lookup like an adjacency matrix while preserving linear memory usage?
  • RQ2How can adjacency list traversal efficiency be maintained in a structure optimized for edge search?
  • RQ3What is the performance trade-off between hash table overhead and the benefits of O(1) edge operations?
  • RQ4Can this structure be efficiently implemented using standard programming constructs like hash tables and linked lists?
  • RQ5How does this structure compare to traditional representations in terms of time and space complexity for common graph operations?

Key findings

  • The proposed structure supports edge insertion and lookup in O(1) average time complexity, combining the speed of adjacency matrices with the memory efficiency of adjacency lists.
  • Adjacency list retrieval for any vertex is achieved in O(degree) time, preserving the efficiency of linked list traversal.
  • The data structure uses O(V + E) memory, matching the space complexity of adjacency lists and avoiding the O(V²) memory of adjacency matrices.
  • The implementation in Java demonstrates practical feasibility and performance benefits in dynamic graph applications.
  • The hybrid approach effectively balances time and space efficiency, making it suitable for graphs with frequent edge modifications.
  • Empirical results from the implementation show that the structure outperforms pure adjacency list and matrix representations in workloads involving frequent edge queries and updates.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.