@@ -78,19 +78,21 @@ def _construct_graph_from_weighted_adjacency(
7878):
7979 """Generates a graph from its weighted adjacency matrix.
8080
81+ Only edges with a non-zero weight are created.
82+
8183 @param matrix: the adjacency matrix. Possible types are:
8284 - a list of lists
8385 - a numpy 2D array or matrix (will be converted to list of lists)
8486 - a scipy.sparse matrix (will be converted to a COO matrix, but not
8587 to a dense matrix)
8688 @param mode: the mode to be used. Possible values are:
8789 - C{"directed"} - the graph will be directed and a matrix element
88- specifies the number of edges between two vertices .
90+ specifies the weight of the corresponding edge .
8991 - C{"undirected"} - the graph will be undirected and a matrix element
90- specifies the number of edges between two vertices . The matrix must
92+ specifies the weight of the corresponding edge . The matrix must
9193 be symmetric.
92- - C{"max"} - undirected graph will be created and the number of
93- edges between vertex M{i} and M{j} is M{max(A(i,j), A(j,i))}
94+ - C{"max"} - undirected graph will be created and the weight of the
95+ edge between vertex M{i} and M{j} is M{max(A(i,j), A(j,i))}
9496 - C{"min"} - like C{"max"}, but with M{min(A(i,j), A(j,i))}
9597 - C{"plus"} - like C{"max"}, but with M{A(i,j) + A(j,i)}
9698 - C{"upper"} - undirected graph with the upper right triangle of
0 commit comments