Class ValueGraphBuilder<N,​V>


  • @Beta
    public final class ValueGraphBuilder<N,​V>
    extends java.lang.Object
    A builder for constructing instances of MutableValueGraph with user-defined properties.

    A graph built by this class will have the following properties by default:

    • does not allow self-loops
    • orders Graph.nodes() in the order in which the elements were added

    Example of use:

    
     MutableValueGraph<String, Double> graph =
         ValueGraphBuilder.undirected().allowsSelfLoops(true).build();
     graph.putEdgeValue("San Francisco", "San Francisco", 0.0);
     graph.putEdgeValue("San Jose", "San Jose", 0.0);
     graph.putEdgeValue("San Francisco", "San Jose", 48.4);
     
    Since:
    20.0
    Author:
    James Sexton, Joshua O'Madadhain