TEC-Bridge Logo

Adjacency Matrix Data Structure Visualizer

STEM Interactive Visual Learning Program at TEC-Bridge AI

Adjacency Matrix Setup

Adjacency Matrix Operations

Matrix Visualization

Operation Steps

How to Use

  1. Add Node: Enter a label and click "Add Node"
  2. Add Edge: Enter source and destination, click "Add Edge"
  3. Random Matrix Graph: Click to instantly generate a sample graph with random nodes and edges.
  4. Remove Node/Edge: Enter node or edge and click remove
  5. Is Connected?: Click to check if the graph is connected
  6. Is Symmetric?: Click to check if the matrix is symmetric (undirected)
  7. Reset: Click to clear the matrix

Adjacency Matrix Concept

Adjacency Matrix is a 2D array used to represent a graph. Each cell (i, j) indicates if there is an edge from node i to node j.

Key Characteristics:

  • Efficient for dense graphs
  • Easy to check edge existence
  • Space: O(V^2)
  • Can represent both directed and undirected graphs

Purpose & Applications

  • Network analysis
  • Social networks
  • Shortest path algorithms
  • Graph algorithms (Floyd-Warshall, etc.)

Time & Space Complexity

Operation Time Complexity Space Complexity
Add Node O(V^2) O(V^2)
Add Edge O(1) O(1)
Remove Node O(V^2) O(V^2)
Remove Edge O(1) O(1)
Is Connected? O(V^2) O(V^2)
Is Symmetric? O(V^2) O(V^2)

Strengths & Limitations

Strengths:

  • Simple and intuitive
  • Fast edge lookup
  • Good for dense graphs

Limitations:

  • High space usage for sparse graphs
  • Not efficient for very large graphs

Adjacency Matrix Code Implementation

© 2025 TEC-Bridge AI. All rights reserved. | Contact: contact@tec-bridge.ai | https://tec-bridge.ai