Re: [jgrapht-developers] dumping adjacency and laplacian matrices
Brought to you by:
barak_naveh,
perfecthash
From: Charles F. <cf...@us...> - 2005-12-14 00:04:40
|
> MatrixExporter sounds good. A pattern you might consider instead of > static methods is to support "knob" methods for tweaking the formatting > before the export, e.g. Excelent. Now that I'm getting a little deeper into this, I realized that a Laplacian matrix is only defined for "an undirected, unweighted graph without graph loops (i,i) or multiple edges from one node to another [1]." 1. http://mathworld.wolfram.com/LaplacianMatrix.html Currently there are interfaces for Directed and Undirected graphs, but no interfaces are used to mark Multigraphs or Pseudographs. It is thus impossible for me to tell beforehand whether or not the graph provided contains loops or multiple edges. The possible solutions that I see to this are to: - Define interfaces that indicate when multiple edges or loops are permitted in a graph, and explicitely check those, possibly issuing a warning. - Ignore loops, and collapse multiple edges when creating the Laplacian matrix. I don't see any reason not to do the latter, although the former may still be beneficial for other reasons. Thoughts? Charles -- Drinking drivers-- Nothing worse They put The quart Before the hearse Burma-Shave http://burma-shave.org/jingles/1959/drinking_drivers |