Notice: Undefined index: multi_edge_mode in /home/u294241901/domains/codingace.net/public_html/maths/adjacency_matrix_generator.php on line 64

Notice: Undefined index: absent_value in /home/u294241901/domains/codingace.net/public_html/maths/adjacency_matrix_generator.php on line 66
Adjacency Matrix Generator Calculator

Adjacency Matrix Generator Calculator

Create graph matrices from custom labeled vertices and edges. Compare directed, weighted, and looped networks. Study relationships accurately with clear summaries and exportable reports.

Build your graph matrix

Enter vertices, edge pairs, and options. The calculator supports directed, undirected, weighted, and loop-enabled graphs.

Use one edge per line. Unweighted format: source,target. Weighted format: source,target,weight.

Example data table

This sample shows how labels and edges translate into a compact matrix summary.

Example item Value Interpretation
Vertex labels A, B, C, D Four vertices define a 4 × 4 matrix.
Edge list A,B | A,C | B,D | C,D Each row gives one connection between two vertices.
Graph mode Undirected, unweighted The matrix becomes symmetric across the diagonal.
Density 0.667 Four edges exist out of six possible simple edges.
Degree pattern A=2, B=2, C=2, D=2 Every vertex participates in two connections.

Formula used

For vertices v1 ... vn, the adjacency matrix A stores one value for every ordered pair of vertices.

Unweighted case: Aij = 1 when an edge connects vi to vj, otherwise Aij = 0.

Weighted case: Aij = w(vi, vj) when the edge exists, otherwise Aij equals the chosen absent value.

Directed density: density = m / [n(n − 1)] without loops, or m / n2 with loops.

Undirected density: density = m / [n(n − 1) / 2] without loops, or m / [n(n + 1) / 2] with loops.

Degree totals: row sums measure outgoing links, column sums measure incoming links, and undirected degree equals the row sum plus its diagonal value when loops are present.

How to use this calculator

  1. Enter an optional graph name to label exports and results.
  2. Add comma-separated vertex labels, or let the calculator derive them from your edge list.
  3. Choose directed or undirected mode, then switch weighted edges on when each edge has its own value.
  4. Select whether loops are allowed and how repeated edges should be handled.
  5. Type one edge per line using source,target or source,target,weight.
  6. Click Generate Matrix to place the result above the form under the page header.
  7. Review the matrix, row sums, column sums, density, symmetry, and degree summary.
  8. Use the CSV and PDF buttons to export the generated matrix for notes, reports, or homework checks.

Frequently asked questions

1. What does an adjacency matrix show?

It shows whether each vertex connects to every other vertex. In weighted graphs, the matrix stores edge weights instead of simple ones and zeros.

2. When is the matrix symmetric?

The matrix is symmetric when the graph is undirected and mirrored edge values match on both sides of the main diagonal.

3. Can I build a weighted directed graph?

Yes. Turn on directed mode and weighted mode, then provide each edge as source,target,weight on its own line.

4. How are repeated edges handled?

You can mark repeated edges as simple presence, sum their values, or overwrite earlier entries with the latest supplied edge.

5. What happens if vertices are missing?

When auto add is enabled, unseen labels found in edges are appended automatically. Otherwise, those edges are ignored with a warning.

6. Why do row and column sums matter?

They summarize connectivity quickly. In directed graphs they estimate outgoing and incoming totals. In undirected graphs they help verify degree patterns.

7. Does the calculator support self loops?

Yes, when the self-loop option is enabled. Then diagonal entries may contain ones or supplied weights for same-vertex edges.

8. Why export the matrix?

Exports make it easier to archive results, attach them to coursework, compare graph versions, and share matrices with collaborators.

Related Calculators

topological sort calculatorminimum spanning tree calculatorgraph distance calculatorbreadth first search calculatorford fulkerson calculatorvertex degree calculatorconnected components counterfloyd warshall calculatoreulerian path calculatorsteiner tree calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.