Version (2.2 KB) by Ondrej
Conversion from graph incidence matrix to adjacency matrix.
Updated 25 Feb 2016

View License

Returns a sparse adjacency matrix 'mAdj' according to the incidence matrix 'mInc'. The rows in the incidence matrix must represent the edges, while the columns the vertices.
Function can handle directed graphs with incidence matrix containing -1s, indicating an "in-going" edge, and 1s indicating an "out-going" edge.

Cite As

Ondrej (2024). inc2adj(mInc) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Directed Graphs in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

checks for correct input added (Thanks to Kaif Agbaje)

input consistency check modified

handled case when the input matrix is zero

Major code optimization (Thanks to Andreas Gunnel for inspiration)

faster check of the input matrix