V
- the graph vertex typeE
- the graph edge typepublic class DIMACSExporter<V,E> extends Object implements GraphExporter<V,E>
For a description of the format see
http://dimacs.rutgers.edu/Challenges. Note that there are a lot of different formats based on
each different challenge, see DIMACSFormat
for the supported formats. The exporter uses
the DIMACSFormat.MAX_CLIQUE
by default.
Modifier and Type | Class and Description |
---|---|
static class |
DIMACSExporter.Parameter
Parameters that affect the behavior of the
DIMACSExporter exporter. |
Modifier and Type | Field and Description |
---|---|
static DIMACSFormat |
DEFAULT_DIMACS_FORMAT
The default format used by the exporter.
|
protected ComponentNameProvider<E> |
edgeIDProvider
Provides an identifier for an edge.
|
protected ComponentNameProvider<V> |
vertexIDProvider
Provides an identifier for a vertex.
|
Constructor and Description |
---|
DIMACSExporter()
Constructs a new exporter.
|
DIMACSExporter(ComponentNameProvider<V> vertexIDProvider)
Constructs a new exporter with a given vertex ID provider.
|
DIMACSExporter(ComponentNameProvider<V> vertexIDProvider,
DIMACSFormat format)
Constructs a new exporter with a given vertex ID provider.
|
Modifier and Type | Method and Description |
---|---|
void |
exportGraph(Graph<V,E> g,
Writer writer)
Export a graph
|
ComponentNameProvider<E> |
getEdgeIDProvider()
Get the edge id provider
|
DIMACSFormat |
getFormat()
Get the format of the exporter
|
ComponentNameProvider<V> |
getVertexIDProvider()
Get the vertex id provider
|
boolean |
isParameter(DIMACSExporter.Parameter p)
Return if a particular parameter of the exporter is enabled
|
void |
setEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)
Set the edge id provider.
|
void |
setFormat(DIMACSFormat format)
Set the format of the exporter
|
void |
setParameter(DIMACSExporter.Parameter p,
boolean value)
Set the value of a parameter of the exporter
|
void |
setVertexIDProvider(ComponentNameProvider<V> vertexIDProvider)
Set the vertex id provider
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exportGraph, exportGraph
public static final DIMACSFormat DEFAULT_DIMACS_FORMAT
protected ComponentNameProvider<V> vertexIDProvider
protected ComponentNameProvider<E> edgeIDProvider
public DIMACSExporter()
public DIMACSExporter(ComponentNameProvider<V> vertexIDProvider)
vertexIDProvider
- for generating vertex IDs. Must not be null.public DIMACSExporter(ComponentNameProvider<V> vertexIDProvider, DIMACSFormat format)
vertexIDProvider
- for generating vertex IDs. Must not be null.format
- the format to usepublic void exportGraph(Graph<V,E> g, Writer writer)
exportGraph
in interface GraphExporter<V,E>
g
- the graph to exportwriter
- the output writerpublic boolean isParameter(DIMACSExporter.Parameter p)
p
- the parametertrue
if the parameter is set, false
otherwisepublic void setParameter(DIMACSExporter.Parameter p, boolean value)
p
- the parametervalue
- the value to setpublic DIMACSFormat getFormat()
public void setFormat(DIMACSFormat format)
format
- the format to usepublic ComponentNameProvider<V> getVertexIDProvider()
public void setVertexIDProvider(ComponentNameProvider<V> vertexIDProvider)
vertexIDProvider
- the new vertex id provider. Must not be null.public ComponentNameProvider<E> getEdgeIDProvider()
public void setEdgeIDProvider(ComponentNameProvider<E> edgeIDProvider)
edgeIDProvider
- the new edge id provider. Must not be null.Copyright © 2019. All rights reserved.