Return incidence matrix of G.
The incidence matrix assigns each row to a node and each column to an edge. For a standard incidence matrix a 1 appears wherever a row’s node is incident on the column’s edge. For an oriented incidence matrix each edge is assigned an orientation (arbitrarily for undirected and aligning to direction for directed). A -1 appears for the tail of an edge and 1 for the head of the edge. The elements are zero otherwise.
Parameters : | G : graph
nodelist : list, optional (default= all nodes in G)
edgelist : list, optional (default= all edges in G)
oriented: bool, optional (default=False) :
weight : string or None, optional (default=None)
|
---|---|
Returns : | A : NumPy matrix
|
Notes
For MultiGraph/MultiDiGraph, the edges in edgelist should be (u,v,key) 3-tuples.
“Networks are the best discrete model for so many problems in applied mathematics” [R246].
References
[R246] | (1, 2) Gil Strang, Network applications: A = incidence matrix, http://academicearth.org/lectures/network-applications-incidence-matrix |