>
> > 4. In the second call, there should not be loops at each vertex.
>
> Yes, there should be. It's a weighted graph with loops on the vertices,
> since the laplacian has nonzero diagonal entries.
>
> Thanks,
>
> Jason
The diagonal entries in the laplacian give the out_degrees of the
corresponding vertices minus the weight of any loops. Here is a
simpler example showing that something is wrong.
sage: G.laplacian_matrix()
[ 2 -1 -1]
[-1 2 -1]
[-1 -1 2]
sage: G = DiGraph({1:{2:1, 3:1}, 2:{1:1, 3:1}, 3:{1:1, 2:1}})
sage: G.laplacian_matrix()
[ 2 -1 -1]
[-1 2 -1]
[-1 -1 2]
sage: G.show()
sage: DiGraph(G.laplacian_matrix()).show()
In this case, G is an ordinary triangle---no loops at vertices. Each
vertex has out_degree 2.
1. G.show() is wrong since it misses some arrows.
2. DiGraph(G.laplacian_matrix()).show() is wrong because it displays
loops at the vertices.
3. DiGraph(G.laplacian_matrix()).show() is also wrong because is
missing arrowheads.
4. To clarify an earlier question: why aren't G.show() and DiGraph
(G.laplacian_matrix()).show() the same?
4. To further complicate matters, I think that
DiGraph(G.laplacian_matrix()).show(edge_labels=True)
should label edges by their weights, not by the negative of their
weights.
David
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---