Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum > General > > "Build graph from incidency matrix"

Post Reply:
Name:
Email Address:

Please send email when my message is replied to.

Url (optional):
Subject:
Message: view original message?
Attachment (optional):
Please answer this:1+1 =



Original Message (ID '98744') By Peter Pein:
Hi Anton, with a = {{0, 1, 1, 0, 0, 0, 1, 0, 0}, {1, 0, 1, 0, 1, 0, 0, 1, 0}, {1, 1, 0, 0, 0, 1, 0, 0, 1}, {0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 1, 0, 1, 0}, {0, 0, 1, 1, 1, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 1, 1}, {0, 1, 0, 0, 1, 0, 1, 0, 1}, {0, 0, 1, 0, 0, 1, 1, 1, 0}}; you do not have an incidence matrix, because Plus @@@ Transpose[a] {3, 4, 4, 1, 3, 4, 3, 4, 4} shows us there would be edges with three or more vertices attached to them. I guess, you've got an adjacency matrix: GraphPlot[g = AdjacencyGraph[Range@Length@a, a], VertexLabeling -> True] gives a well defined graph and the incidence matrix has got two ones per column as it should have(try: Plus @@@ Transpose[IncidenceMatrix[g]]). hth, Peter