PajekNetReader
and PajekNetWriter
public class PajekNetFile extends java.lang.Object implements GraphFile
Here is an example format for a directed graph without edge weights
and edges specified in list form:
*vertices <# of vertices> 1 "a" 2 "b" 3 "c" *arcslist 1 2 3 2 3Here is an example format for an undirected graph with edge weights and edges specified in non-list form:
*vertices <# of vertices> 1 "a" 2 "b" 3 "c" *edges 1 2 0.1 1 3 0.9 2 3 1.0
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EDGE_WEIGHT
Deprecated.
|
Constructor and Description |
---|
PajekNetFile()
Deprecated.
Default constructor for pajek graph reader
|
PajekNetFile(java.lang.String[] edgeKeys)
Deprecated.
Constructor which takes in the user datum keys for the edge weights
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getEdgeKeys()
Deprecated.
retrieves the set of edge keys the algorithm will use to store the edge weights
|
Graph |
load(java.io.Reader read)
Deprecated.
Loads a graph for the given BufferedReader (where the data is assumed to be in Pajek NET format).
|
Graph |
load(java.lang.String filename)
Deprecated.
Loads a graph from disk for the given .net file
If the edges are directed then a directed graph will be created, otherwise an undirected graph will be created
|
void |
save(Graph graph,
java.lang.String filename)
Deprecated.
Writes
graph to the file specified by filename
in the Pajek NET format. |
void |
setCreateDirectedOnly(boolean createDirectedOnly)
Deprecated.
Forces a graph that is normally undirected to be loaded in as its directed equivalent
|
void |
setEdgeKeys(java.lang.String[] edgeKeys)
Deprecated.
set the edge the algorithm will use to store the edge weights
|
public static final java.lang.String EDGE_WEIGHT
public PajekNetFile()
public PajekNetFile(java.lang.String[] edgeKeys)
edgeKeys
- the user datum keys the algorithm should use to store the edge weights (as MutableDoubles)public java.lang.String[] getEdgeKeys()
public void setEdgeKeys(java.lang.String[] edgeKeys)
edgeKeys
- the user datum keys the algorithm should use to store the edge weights (as MutableDoubles)public Graph load(java.lang.String filename)
public void setCreateDirectedOnly(boolean createDirectedOnly)
createDirectedOnly
- if true, force graph to be directed, false to not force this constraintpublic Graph load(java.io.Reader read)
read
- the data stream that contains the graph data in .net formatpublic void save(Graph graph, java.lang.String filename)
graph
to the file specified by filename
in the Pajek NET format.