galois.objects.graph
Class MorphGraph.LongGraphBuilder

java.lang.Object
  extended by galois.objects.graph.MorphGraph.LongGraphBuilder
Enclosing class:
MorphGraph

public static class MorphGraph.LongGraphBuilder
extends Object

A MorphGraph builder, providing combinations of several features.


Constructor Summary
MorphGraph.LongGraphBuilder()
          Constructs a new builder instance with the following default settings: the graph will be undirected, parallel, and backed by a hash map.
 
Method Summary
 MorphGraph.LongGraphBuilder backedByVector(boolean backedByVector)
          Indicates whether the underlying implementation of the graph should use a ArrayList or a HashMap for representing the set of neighbors of a node.
<N extends GObject>
LongGraph<N>
create()
          Builds the final graph.
 MorphGraph.LongGraphBuilder directed(boolean directed)
          Indicates whether edges in the graph are directed or not.
 MorphGraph.LongGraphBuilder serial(boolean serial)
          Indicates whether the implementation of the graph about to be created is serial (there is no concurrency or transactional support) or parallel (can be safely used within Galois iterators).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MorphGraph.LongGraphBuilder

public MorphGraph.LongGraphBuilder()
Constructs a new builder instance with the following default settings: the graph will be undirected, parallel, and backed by a hash map.

Method Detail

serial

public MorphGraph.LongGraphBuilder serial(boolean serial)
Indicates whether the implementation of the graph about to be created is serial (there is no concurrency or transactional support) or parallel (can be safely used within Galois iterators). For example, a graph that is purely thread local can benefit from using a serial implementation, which is expected to add no overheads due to concurrency or the runtime system.

Parameters:
serial - boolean value that indicates whether the graph is serial or not.

directed

public MorphGraph.LongGraphBuilder directed(boolean directed)
Indicates whether edges in the graph are directed or not.

Parameters:
directed - boolean flag that indicates whether the graph is directed.

backedByVector

public MorphGraph.LongGraphBuilder backedByVector(boolean backedByVector)
Indicates whether the underlying implementation of the graph should use a ArrayList or a HashMap for representing the set of neighbors of a node. The chosen representation has an impact on performance. As a rule of thumb, use vector-based representations if and only if the set of neighbors of every node in the graph remains sparse throughout the computation.

Parameters:
backedByVector - flag that indicates whether to use the vector-based representation.

create

public <N extends GObject> LongGraph<N> create()
Builds the final graph. This method does not alter the state of this builder instance, so it can be invoked again to create multiple independent graphs.

Type Parameters:
N - the type of the object stored in each node
Returns:
a long graph with the requested features