Package org.jgrapht.ext
Class MatrixExporter<V,E>
- java.lang.Object
-
- org.jgrapht.ext.MatrixExporter<V,E>
-
-
Constructor Summary
Constructors Constructor Description MatrixExporter()
Creates a new MatrixExporter object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exportAdjacencyMatrix(java.io.Writer output, DirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's adjacency matrix.void
exportAdjacencyMatrix(java.io.Writer output, UndirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's adjacency matrix.void
exportLaplacianMatrix(java.io.Writer output, UndirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's Laplacian matrix.void
exportNormalizedLaplacianMatrix(java.io.Writer output, UndirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's normalized Laplacian matrix.
-
-
-
Method Detail
-
exportAdjacencyMatrix
public void exportAdjacencyMatrix(java.io.Writer output, UndirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's adjacency matrix. The value stored in each position of the matrix indicates the number of edges between two vertices. With an undirected graph, the adjacency matrix is symetric.- Parameters:
output
- the writer to which the graph to be exported.g
- the graph to be exported.
-
exportAdjacencyMatrix
public void exportAdjacencyMatrix(java.io.Writer output, DirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's adjacency matrix. The value stored in each position of the matrix indicates the number of directed edges going from one vertex to another.- Parameters:
output
- the writer to which the graph to be exported.g
- the graph to be exported.
-
exportLaplacianMatrix
public void exportLaplacianMatrix(java.io.Writer output, UndirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's Laplacian matrix. Laplacian matrices are only defined for simple graphs, so edge direction, multiple edges, loops, and weights are all ignored when creating the Laplacian matrix. If you're unsure about Laplacian matrices, see: http://mathworld.wolfram.com/LaplacianMatrix.html.- Parameters:
output
- the writer to which the graph is to be exported.g
- the graph to be exported.
-
exportNormalizedLaplacianMatrix
public void exportNormalizedLaplacianMatrix(java.io.Writer output, UndirectedGraph<V,E> g)
Exports the specified graph into a plain text file format containing a sparse representation of the graph's normalized Laplacian matrix. Laplacian matrices are only defined for simple graphs, so edge direction, multiple edges, loops, and weights are all ignored when creating the Laplacian matrix. If you're unsure about normalized Laplacian matrices, see: http://mathworld.wolfram.com/LaplacianMatrix.html.- Parameters:
output
- the writer to which the graph is to be exported.g
- the graph to be exported.
-
-