public class ArrayBasedGraphLoader
extends java.lang.Object
Constructor and Description |
---|
ArrayBasedGraphLoader() |
Modifier and Type | Method and Description |
---|---|
static ArrayBasedGraph |
constructFromPolyhedron(Polyhedron_3<Point_> polyhedron)
Construct the graph corresponding to the 1-skeleton of a 3D surface.
|
static int |
getNumberOfNodes(java.lang.String filename)
Get the number of nodes of a graph (stored as an edge list)
Remark: we assume there is no header (no number of nodes stored)
|
static ArrayBasedGraph |
readEdgeListGraphFromFile(java.lang.String filename)
Load a graph from a file storing an edge list
Remark: there is no header
|
static ArrayBasedGraph |
readGraphFromFile(java.lang.String filename)
Load a graph from a file storing an edge list
Remark: the header (first line) contains the number of nodes and arcs
|
static ArrayBasedGraph |
readMetisFile(java.lang.String filename)
Load a graph from a file (in Metis format)
Warning: to check whether edges should appear once or twice
Remarks:
-) vertex indices range from 1 to n (instead of 0..n-1)
-) edges appear only once in the file
|
static void |
writeGraphToFile(ArrayBasedGraph g,
java.lang.String filename)
Encode (the connectivity of) a given graph into a text file
|
static void |
writeMeshSkeletonToFile(java.lang.String meshname,
java.lang.String output)
Construct the skeleton graph from a mesh and encode it into a file
Warning: it works only for triangle meshes
|
public static ArrayBasedGraph readGraphFromFile(java.lang.String filename)
filename
- the input file encoding the graphpublic static ArrayBasedGraph readEdgeListGraphFromFile(java.lang.String filename)
filename
- the input file encoding the graphpublic static int getNumberOfNodes(java.lang.String filename)
filename
- the input file encoding the graphpublic static ArrayBasedGraph readMetisFile(java.lang.String filename)
filename
- the input file encoding the graph (lists of neighbors)public static void writeGraphToFile(ArrayBasedGraph g, java.lang.String filename)
g
- the graph to encodefilename
- the output filepublic static void writeMeshSkeletonToFile(java.lang.String meshname, java.lang.String output)
meshname
- the file storing the meshoutput
- the output file (encoding the graph)public static ArrayBasedGraph constructFromPolyhedron(Polyhedron_3<Point_> polyhedron)