Simplify Your Workflow: Search MiniWebtool.
Add Extension
See also
Graph Coloring CalculatorGraph Degree Sequence ValidatorTopological Sort CalculatorSVG to React/JSX Converter
Home Page > Math > Advanced Math Operations > Adjacency Matrix Calculator

Adjacency Matrix Calculator

Convert between adjacency matrix, edge list, and adjacency list. Auto-detects directed/undirected graphs, computes degree sequence, density, connected components, and matrix powers โ€” with an interactive SVG graph visualization.

Adjacency Matrix Calculator
Accepts A-B, A->B, A B, A,B, or matrix rows like 0 1 1 0. Use letters, digits, or underscores for vertex labels.
Comma- or space-separated labels, one per matrix row. Defaults to A, B, Cโ€ฆ if omitted.

Embed Adjacency Matrix Calculator Widget

About Adjacency Matrix Calculator

The Adjacency Matrix Calculator is a graph-theory utility that converts between the three canonical graph representations โ€” adjacency matrix, edge list, and adjacency list โ€” and enriches the result with structural analysis: degree sequence, graph density, connected components, and matrix powers. It auto-detects whether your input describes a directed or undirected graph and renders a live SVG visualization alongside every result.

What Is an Adjacency Matrix?

Given a graph G = (V, E) with n vertices, its adjacency matrix is the n ร— n square matrix A whose entry A[i][j] is 1 if there is an edge from vertex i to vertex j, and 0 otherwise.

A[i][j] = 1 if (vi, vj) โˆˆ E , else 0

For an undirected graph, the adjacency matrix is always symmetric: every edge {u, v} contributes both A[u][v] = 1 and A[v][u] = 1. For a directed graph (digraph), the matrix may be asymmetric, reflecting the direction of each arc.

Three Representations โ€” Pick What Fits Your Problem

Representation Space Edge lookup List neighbors Best for
Adjacency matrix ฮ˜(nยฒ) O(1) ฮ˜(n) Dense graphs; matrix algebra (powers, eigenvalues)
Adjacency list ฮ˜(n + m) O(deg v) ฮ˜(deg v) Sparse graphs; BFS/DFS and shortest-path algorithms
Edge list ฮ˜(m) ฮ˜(m) ฮ˜(m) Input/output, Kruskal's MST, edge-centric algorithms

Key Metrics Computed

Degree Sequence

For undirected graphs, the degree of a vertex is the number of edges incident to it (with self-loops counting twice). For directed graphs, each vertex has an in-degree (incoming arcs) and out-degree (outgoing arcs). The sorted list of degrees is a classical graph invariant used in isomorphism testing and the Erdล‘sโ€“Gallai realisability theorem.

Handshaking Lemma: ฮฃ deg(v) = 2m (undirected) ฮฃ in-deg(v) = ฮฃ out-deg(v) = m (directed)

Graph Density

Density measures how "full" a graph is relative to the maximum number of edges possible on n vertices.

Undirected: D = 2m / (n(nโˆ’1)) Directed: D = m / (n(nโˆ’1))

A density of 0 means no edges, 1 means the graph is complete, and values below 0.1 typically indicate a sparse graph where an adjacency list is more space-efficient than a matrix.

Connected Components

A connected component is a maximal subset of vertices such that every pair is joined by a path. For directed graphs, this calculator reports weakly connected components (ignoring arrow directions) โ€” the same subsets you'd get by treating each arc as an undirected edge.

Matrix Powers (Aยฒ, Aยณ ... )

A fundamental theorem of algebraic graph theory states that the (i, j) entry of Ak equals the number of walks of exactly length k from vertex i to vertex j. Consequently:

Input Formats Accepted

1. Edge list

One edge per line or comma-separated. Any of these separators work: A-B, A B, A,B, A->B, A--B. Use -> if you want to force a directed interpretation.

A-B, B-C, C-A, C-D (undirected 4-cycle with a tail) A->B, B->C, C->D, D->A (directed cycle of length 4)

2. Adjacency list

One line per vertex, in the form vertex: neighbor1, neighbor2, .... Order doesn't matter; missing vertices are added automatically from the neighbor lists.

A: B, C, D B: A, C C: A, B, D D: A, C

3. Adjacency matrix

One row per line with space- or comma-separated 0/1 values. The matrix must be square. Optionally provide custom labels in the Matrix labels field (otherwise A, B, Cโ€ฆ are used).

0 1 1 0 1 0 1 1 1 1 0 1 0 1 1 0

How to Use This Calculator

  1. Pick an input format using the tabbed selector: edge list, adjacency list, or adjacency matrix.
  2. Paste or type your graph in the text area. For matrix input, add optional labels in the Matrix labels field.
  3. Select graph type โ€” leave on Auto-detect and the calculator will infer directedness from arrows (->) or matrix symmetry. Force it to Directed or Undirected if you want to override.
  4. Click Convert & Analyze Graph. The result page shows the adjacency matrix, an interactive SVG rendering, the other two text representations, degree statistics, connected components, and walk-count matrices Aยฒ and Aยณ when the graph is small enough.
  5. Hover a matrix row or a graph node to light up the matching row/column and incident edges โ€” an instant visual proof that each format encodes the same information.

Worked Example

Consider an undirected graph on vertices {A, B, C, D} with edges AB, BC, CA, CD. The adjacency matrix is:

A B C D A [ 0 1 1 0 ] B [ 1 0 1 0 ] C [ 1 1 0 1 ] D [ 0 0 1 0 ]

Key facts the calculator derives:

Common Applications

Frequently Asked Questions

What is an adjacency matrix?

An adjacency matrix is an n ร— n square matrix used to represent a finite graph. Each cell A[i][j] is 1 if there is an edge from vertex i to vertex j, and 0 otherwise. For undirected graphs the matrix is symmetric, so A[i][j] = A[j][i]. The matrix makes it easy to check whether two vertices are connected in constant time, and matrix powers encode the number of walks between vertices.

How do I tell if a graph is directed from its adjacency matrix?

If the adjacency matrix is symmetric, meaning A[i][j] equals A[j][i] for every pair of indices, the graph is undirected. If there is at least one pair where A[i][j] differs from A[j][i], the graph is directed. This calculator performs that symmetry check automatically when you pick the Auto-detect option.

What does the k-th power of an adjacency matrix represent?

The entry (i, j) of A^k counts the number of walks of exactly length k from vertex i to vertex j. For example, Aยฒ[i][j] is the number of 2-step paths, which equals the number of common neighbors between i and j in undirected graphs. This property is used in algorithms for triangle counting, reachability, and PageRank-style computations.

What is graph density?

Graph density is the ratio of the number of edges present to the maximum possible number of edges. For an undirected simple graph with n vertices, density = 2m / (n(n-1)). For a directed graph, density = m / (n(n-1)). A density near 0 means a sparse graph; a density of 1 means a complete graph.

How is an adjacency matrix different from an adjacency list?

An adjacency matrix stores connectivity for every pair of vertices using nยฒ bits, making neighbor lookup O(1) but memory usage O(nยฒ). An adjacency list stores only the actual neighbors of each vertex, giving O(n + m) memory, which is far smaller for sparse graphs, but neighbor lookup requires a linear scan. Matrices are better for dense graphs and matrix-algebra operations; lists are better for sparse graphs and traversal algorithms like BFS/DFS.

Can this tool handle weighted graphs?

The current calculator focuses on unweighted adjacency matrices with 0/1 entries. If you paste a matrix with non-zero numeric weights, every non-zero cell is treated as a 1 for structural analysis. For weighted graph computations such as shortest-path, consider a dedicated weighted-graph tool.

Further Reading

Reference this content, page, or tool as:

"Adjacency Matrix Calculator" at https://MiniWebtool.com/adjacency-matrix-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 20, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Advanced Math Operations:

Top & Updated:

Instagram User ID LookupRandom Name Picker WheelRandom PickerImage ResizerFacebook User ID LookupLine CounterSort NumbersRSD Calculator - Relative Standard DeviationFPS ConverterMAC Address GeneratorRemove SpacesWord to Phone Number Converterโฌ› Aspect Ratio Calculator๐Ÿ“ท OCR / Image to TextSun Position CalculatorSun, Moon & Rising Sign Calculator ๐ŸŒž๐ŸŒ™โœจERA CalculatorRandom Quote GeneratorMAC Address Lookup๐Ÿ–ฑ๏ธ Click CounterMerge VideosSlope and Grade CalculatorJob FinderPercent Off CalculatorSquare Root (โˆš) CalculatorWeight Loss CalculatorRandom Truth or Dare GeneratorCm to Feet and Inches ConverterSHA256 Hash GeneratorSum CalculatorBatting Average CalculatorVertical Jump CalculatorMP3 LooperAdd Text to ImageRandom Credit Card GeneratorRandom Poker Hand GeneratorRandom Superpower GeneratorFeet and Inches to Cm ConverterNumber of Digits CalculatorRandom Fake Address GeneratorBitwise CalculatorRoman Numerals ConverterInvisible Text GeneratorRandom IMEI GeneratorSalary Conversion CalculatorPhone Number ExtractorAudio SplitterNumber to Word ConverterRandom Writing Prompt GeneratorImage SplitterRandom Birthday GeneratorText FormatterLog Base 10 CalculatorIP Subnet CalculatorBinary to Gray Code ConverterJulian Date ConverterCaffeine Overdose CalculatorBolt Torque CalculatorLunar Calendar ConverterName RandomizerOctal CalculatorCompound Growth CalculatorRandom Activity GeneratorHalfway Date CalculatorRandom Movie PickerFile Size ConvertereBay Fee CalculatorEmail ExtractorSHA512 Hash GeneratorYouTube Channel StatisticsQuotient and Remainder CalculatorImage CompressorDecimal to BCD ConverterStair CalculatorLeap Years ListLong Division CalculatorFirst n Digits of PiRandom Meal GeneratorWAR CalculatorVideo CompressorOutlier CalculatorHebrew Calendar ConverterBCD to Decimal ConverterWord Ladder GeneratorRandom Loadout GeneratorFlip Video๐Ÿ“… Date CalculatorMaster Number CalculatorOPS CalculatorBcrypt Hash Generator / CheckerCompare Two StringsMD5 Hash GeneratorMultiple Fraction CalculatorSlugging Percentage CalculatorAPI TesterPercent Growth Rate CalculatorAI Language DetectorRandom Number PickerList of Prime NumbersBreak Line by Characters๐Ÿ” Plagiarism CheckerSocial Media Username CheckerDMS to Decimal Degrees ConverterAdd Prefix and Suffix to TextRandomize NumbersIP Address to Hex ConverterArc Length CalculatorDay of the Year Calculator - What Day of the Year Is It Today?Bingo Card GeneratorBroken Link Checker๐ŸŽฐ Gacha Pity CalculatorMultiplication Calculator๐Ÿ”Š Tone GeneratorAstrological Element Balance CalculatorIs it a Prime Number?What is my Zodiac Sign?Percent to PPM ConverterOn Base Percentage CalculatorVideo to Image ExtractorYouTube Tag ExtractorModulo CalculatorGray Code to Binary ConverterAcreage CalculatorVideo SplitterTime Duration CalculatorURL ExtractorSmall Text Generator โฝแถœแต’แต–สธ โฟ แต–แตƒหขแต—แต‰โพCone Flat Pattern (Template) GeneratorMercury Retrograde CalendarNumber ExtractorRemove AccentRandom Chord GeneratorDecibel (dB) CalculatorRandom Tournament Bracket GeneratorSocial Media Post Time OptimizerGreat Circle Distance CalculatorLED Resistor CalculatorName Number CalculatorList RandomizerRandom Emoji GeneratorRandom Object GeneratorWord Scramble GeneratorDay of Year CalendarEstimation CalculatorBattery Life CalculatorRatio CalculatorConnect the Dots GeneratorWHIP CalculatorRandom Math Problem GeneratorSaturn Return CalculatorHeight Percentile CalculatorProportion CalculatorChinese Gender PredictorIP Address to Binary ConverterSquare Numbers ListBinary to BCD ConverterLove Compatibility CalculatorMAC Address AnalyzerGolden Ratio CalculatorRandom Line PickerLottery Number GeneratorText Case ConverterRemove Line BreaksPercentage Increase CalculatorRandom User-Agent GeneratorImage EnhancerFraction CalculatorImage CropperMagic 8-BallRatio to Percentage CalculatorAmortization CalculatorTaco Bar CalculatorBackronym Generator๐Ÿ“Š Bar Graph MakerAngel Number CalculatorPipe Flow CalculatorAdjust Video SpeedScientific Notation to Decimal ConverterWhitespace VisualizerAm I Overweight?HTML CompressorNumber Pattern FinderRandom Video Thumbnail GeneratorFirst n Digits of eLbs to Kg ConverterStandard Error CalculatorWhat is my Lucky Number?Color InverterInvisible Character RemoverReverse VideoRandom Excuse GeneratorPER Calculator๐Ÿ’ง Dew Point CalculatorSigma Notation Calculator (Summation)Effect Size CalculatorMcg to Mg ConverterNumber RandomizerRandom Chess Opening GeneratorAI ParaphraserAI Punctuation AdderSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorAverage CalculatorPVIFA CalculatorHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorRandom String GeneratorRemove Leading Trailing SpacesMarkup CalculatorPVIF CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hรดpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorBernoulli Equation CalculatorSurfboard Volume CalculatorTennis Grip Size CalculatorBackpack Size CalculatorCelsius to Fahrenheit ConverterFahrenheit to Celsius ConverterKm to Miles ConverterMiles to Km ConverterMM to Inches ConverterInches to MM ConverterStone to Kg ConverterKg to Stone ConverterLiters to Gallons ConverterGallons to Liters ConverterML to Oz ConverterOz to ML ConverterSquare Meters to Square Feet ConverterSquare Feet to Square Meters ConverterCubic Feet to Cubic Yards ConverterCubic Meters to Cubic FeetKnots to MPH ConverterMPH to KMH / KMH to MPHMg to Ml ConverterAI Text SummarizerAI TranslatorAI Story GeneratorAI Poem GeneratorAI Song Lyrics GeneratorIndian Land Unit ConverterTola to Gram ConverterPX to REM ConverterPT to PX ConverterMerge PDFSplit PDFCompress PDFPDF to JPGJPG to PDFRotate PDFDelete PDF PagesAdd Page Numbers to PDFProtect PDFReorder PDF PagesPDF Word CounterPDF Page ExtractorPDF to Text ExtractorUnlock PDF (Owner-Password Removal)PDF Flatten ToolAI Rap Lyrics GeneratorAI Cover Letter GeneratorAI Resume Bullet GeneratorAI LinkedIn Headline & Bio GeneratorAI Instagram Caption GeneratorAI YouTube Title & Description GeneratorAI Video Script GeneratorAI Product Description GeneratorAI Press Release GeneratorAI Wedding Speech GeneratorAI Thank-You Note GeneratorAI Dream InterpreterRandom Question GeneratorWould You Rather GeneratorNever Have I Ever GeneratorIcebreaker Question GeneratorCharades GeneratorPictionary Word GeneratorHangman Word GeneratorTrivia Question GeneratorRandom Fact GeneratorRandom Joke GeneratorDad Joke GeneratorPickup Line GeneratorCompliment GeneratorDaily Affirmation GeneratorJournal Prompt GeneratorDrawing Idea GeneratorFortune Cookie GeneratorFantasy Name Generator