Class LedaGraphWriter
- All Implemented Interfaces:
GraphWriter<Integer,Integer>
The LEDA format is a simple format for both directed and undirected graphs, used by the LEDA library. Vertices are numbered from 1 to n, and edges are numbered from 1 to m. It support a single weight for vertices and a single weight for edges. The weights can be any primitive, or a string.
By default, the writer will write the graph without any weights. Its possible to write one of the vertices weights
and one of the edges weights in the format. Use the setVerticesWeightsKey(String) and
setEdgesWeightsKey(String) methods to specify the keys of the weights to write.
- Author:
- Barak Ugav
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetEdgesWeightsKey(String edgesWeightsKey) Set the key of the edges weights to write.voidsetVerticesWeightsKey(String verticesWeightsKey) Set the key of the vertices weights to write.final voidwriteGraph(Graph<Integer, Integer> graph, Writer writer) Write a graph to an I/O writer.voidwriteGraphImpl(Graph<Integer, Integer> graph, Writer writer) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jgalgo.io.GraphWriter
writeGraph, writeGraph
-
Constructor Details
-
LedaGraphWriter
public LedaGraphWriter()Create a new writer.
-
-
Method Details
-
setVerticesWeightsKey
Set the key of the vertices weights to write.By default, the writer will write the graph without any weights. Use this method to specify the key of the vertices weights to write.
- Parameters:
verticesWeightsKey- the key of the vertices weights to write, ornullto write no vertices weights- See Also:
-
setEdgesWeightsKey
Set the key of the edges weights to write.By default, the writer will write the graph without any weights. Use this method to specify the key of the edges weights to write.
- Parameters:
edgesWeightsKey- the key of the edges weights to write, ornullto write no edges weights- See Also:
-
writeGraphImpl
- Throws:
IOException
-
writeGraph
Description copied from interface:GraphWriterWrite a graph to an I/O writer.- Specified by:
writeGraphin interfaceGraphWriter<V,E> - Parameters:
graph- a graphwriter- an I/O writer to which the graph description will be written to
-