Simplify Your Workflow: Search MiniWebtool.
Add Extension
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.

Related MiniWebtools:

Advanced Math Operations:

Top & Updated:

Random Name PickerRandom PickerInstagram User ID LookupFPS ConverterLine CounterSort NumbersRelative Standard Deviation CalculatorImage ResizerMAC Address GeneratorBatting Average CalculatorRemove SpacesFacebook User ID LookupRandom Truth or Dare GeneratorERA CalculatorFeet and Inches to Cm ConverterWord to Phone Number ConverterMAC Address LookupSun, Moon & Rising Sign Calculator 🌞🌙✨Slope and Grade CalculatorPercent Off CalculatorMP3 LooperSum Calculator📷 OCR / Image to TextBitwise CalculatorRandom IMEI GeneratorAudio SplitterInvisible Text GeneratorRoman Numerals ConverterRandom Superpower GeneratorAI Text HumanizerWord Ladder GeneratorRandom Credit Card GeneratorVertical Jump CalculatorSHA256 Hash GeneratorNumber of Digits CalculatorRandom Quote GeneratorHalfway Date CalculatorLog Base 10 CalculatorMerge VideosWAR CalculatorRandom Birthday Generator⬛ Aspect Ratio CalculatorSalary Conversion CalculatorCm to Feet and Inches ConverterMaster Number CalculatorRandom Fake Address GeneratorSaturn Return CalculatorPhone Number ExtractorRandom Activity GeneratorRandom Meal GeneratorOPS CalculatorFile Size ConverterOn Base Percentage CalculatorNumber to Word ConverterIP Subnet CalculatorRandom Writing Prompt GeneratorText FormatterSquare Root (√) CalculatorRandom Poker Hand GeneratorCompound Growth CalculatorSlugging Percentage CalculatorYouTube Channel StatisticsCaffeine Overdose CalculatorBinary to Gray Code ConverterLove Compatibility CalculatorDecimal to BCD ConverterRandom Loadout GeneratorRandom Movie PickerVideo to Image ExtractorBCD to Decimal ConverterOctal CalculatorBattery Life CalculatorMercury Retrograde CalendarLeap Years List🖱️ Click CounterCompare Two StringsStair Calculator📅 Date CalculatorFirst n Digits of PiConnect the Dots GeneratorCM to Inches ConverterRemove Accent🎰 Gacha Pity CalculatorSHA512 Hash GeneratorAdd Text to ImagePercent Growth Rate CalculatorWeight Loss CalculatorPER CalculatorGray Code to Binary ConverterRandom Object GeneratorLottery Number GeneratorBingo Card GeneratorAdd Prefix and Suffix to TextImage CompressorImage SplitterOutlier CalculatorCoin FlipperAstrological Element Balance CalculatorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾Arc Length CalculatorVideo CompressorNumber ExtractorTime Duration CalculatorDay of the Year Calculator - What Day of the Year Is It Today?Quotient and Remainder CalculatorWhat is my Lucky Number?Diff CheckerMultiple Fraction CalculatorFlip VideoList of Prime NumbersProportion CalculatorRandom Emoji GeneratorWhat is my Zodiac Sign?Acreage CalculatorWord Scramble GeneratorIP Address to Hex ConverterBcrypt Hash Generator / CheckerMandelbrot Set ExplorerAngel Number CalculatorBreak Line by CharactersLongest Day of the YearURL ExtractorRandom Line PickerRandom Time GeneratorCone Flat Pattern (Template) GeneratorModulo CalculatorTessellation GeneratorName Number CalculatorBinary to BCD ConverterDay of Year CalendarAI Language DetectorEmail ExtractorDNS LookupRandom Chess Opening Generator🔍 Plagiarism CheckerVideo SplitterMiter Angle CalculatorWHIP CalculatorAntilog CalculatorMD5 Hash GeneratorLunar Calendar ConverterYouTube Tag ExtractorCrossword Puzzle MakerRandomize NumbersRemove Leading Trailing SpacesMartingale Strategy CalculatorRandom Chord GeneratorDMS to Decimal Degrees ConverterIs it a Prime Number?Steel Weight CalculatorAdjust Video SpeedAI Punctuation AdderLong Division CalculatorRandom Number PickerMolarity CalculatorFirst n Digits of eCollage MakerPercentile CalculatorShort Selling Profit CalculatorArctan2 CalculatorJulia Set GeneratorRandom User-Agent GeneratorHeight Percentile CalculatorBolt Torque CalculatorHypotenuse CalculatorMorse Code GeneratorBroken Link CheckerRandom Tournament Bracket GeneratorColor InverterRandom Group GeneratorBonus CalculatorFraction CalculatorHTML CompressorMultiplication CalculatorRounding CalculatorAI ParaphraserPregnancy CalendarYouTube Earnings EstimatorName RandomizerRandom Name GeneratorRatio to Percentage CalculatorBirth Day of the Week CalculatorBoiling Point CalculatorMAC Address AnalyzerPizza Value CalculatorDestiny Number CalculatorSocial Media Username CheckerPVIF CalculatorPVIFA CalculatorGrade CalculatorField Goal Percentage CalculatorSquare Numbers ListHebrew Calendar ConverterLife Path Number CalculatorDue Date CalculatorBoxing Punch Power CalculatorTaco Bar Calculator🎲 Loot Drop Probability CalculatorSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerAverage CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderLbs to Kg ConverterHex to Decimal ConverterConvolution CalculatorRandom String GeneratorAmortization CalculatorMarkup 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 CalculatorSocial Media Post Time OptimizerCTR 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 CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle 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 CalculatorROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability EditorSentence Length Variance AnalyzerWord Frequency AnalyzerBusiness Days CalculatorAdd Business Days to DateDate Pattern GeneratorHow Long Until CalculatorHow Long Ago CalculatorBirthday Across Cultures CalculatorHijri Calendar ConverterInsulin Sensitivity Factor CalculatorCarb-to-Insulin Ratio CalculatorLean Body Mass to Strength CalculatorOne-Mile Walk Test (Rockport) CalculatorCooper 12-Minute Run CalculatorFFMI CalculatorAPGAR Score CalculatorGlasgow Coma Scale CalculatorWells Score Calculator (DVT/PE)Tennis Score TrackerSoccer xG (Expected Goals) CalculatorCricket Run Rate CalculatorRugby Points CalculatorRace Time PredictorSwimming SWOLF CalculatorYoga Pose Hold TimerFishing Knot Strength CalculatorBike Gear Ratio CalculatorClimbing Grade ConverterWine Pairing SuggesterStandard Drink CalculatorCaffeine Half-Life TrackerSpice Substitution FinderDietary Restriction Recipe FilterMarinade Time CalculatorFermentation Time CalculatorSmoking Wood Pairing GuideFreelance Project Pricing CalculatorSaaS Pricing CalculatorSubscription Cost TrackerSide Hustle ROI CalculatorRemote Work Savings CalculatorCoffee Habit Cost CalculatorGym vs Home Workout Cost CalculatorLunch Cost CalculatorWealth Growth Visualizer1031 Exchange CalculatorRental Yield CalculatorCash-on-Cash Return CalculatorBRRRR Method CalculatorSection 8 Rent CalculatorRoommate Rent SplitterAirbnb Pricing OptimizerStatute of Limitations CalculatorSentence Reduction CalculatorSales Tax Nexus CheckerPatent Filing Fee CalculatorTrademark Class FinderWill Asset Distribution CalculatorWorkers' Compensation CalculatorStopping Distance CalculatorTrip Cost SplitterVehicle Weight Distribution CalculatorTrailer Tongue Weight CalculatorTire Tread Wear CalculatorEngine Compression Ratio CalculatorHeadlight Beam Distance CalculatorCat Litter Box CalculatorAquarium Heater Wattage CalculatorBird Cage Size CalculatorReptile Habitat UVB CalculatorPet Travel Crate Size FinderHorse Hay CalculatorCrochet Hook Size ConverterKnitting Needle Size ConverterKnitting Pattern CalculatorCross-Stitch Floss CalculatorQuilt Binding CalculatorOrigami Paper Size CalculatorPottery Clay Shrinkage CalculatorBeading Pattern CalculatorResin Casting Volume CalculatorEmbroidery Thread Length CalculatorHiking Pace Calculator (Naismith's Rule)Backpacking Food Weight CalculatorTent Footprint Size CalculatorSleeping Bag Temperature Rating GuideKnot Tying Reference ToolStar Visibility CalculatorTide Time CalculatorSun Position CalculatorReynolds Number CalculatorBernoulli Equation CalculatorHeat Transfer CalculatorThermal Expansion CalculatorSpecific Heat Capacity CalculatorGear Ratio Calculator (Mechanical)Pulley System CalculatorHydraulic Cylinder Force CalculatorBelt Length CalculatorCloset Capsule CalculatorStorage Unit Size CalculatorMoving Box Quantity CalculatorGift Card Tip CalculatorGas vs Electric Cost ComparisonPrint Cost CalculatorHair Dye Mixing CalculatorLaundry Detergent Dosage CalculatorDishwasher Load OptimizerTile Grout CalculatorPaint Color Mixing CalculatorFlashcard Spaced Repetition SchedulerLearning Curve Calculator