Package com.jgalgo

Interface Graph.Builder

    • Method Detail

      • build

        Graph build()
        Create a new empty graph.
        Returns:
        a new graph with the builder options
      • setDirected

        Graph.Builder setDirected​(boolean directed)
        Determine if graphs built by this builder should be directed or not.
        Parameters:
        directed - if true, graphs built by this builder will be directed
        Returns:
        this builder
      • expectedVerticesNum

        Graph.Builder expectedVerticesNum​(int expectedVerticesNum)
        Set the expected number of vertices that will exist in the graph.
        Parameters:
        expectedVerticesNum - the expected number of vertices in the graph
        Returns:
        this builder
      • expectedEdgesNum

        Graph.Builder expectedEdgesNum​(int expectedEdgesNum)
        Set the expected number of edges that will exist in the graph.
        Parameters:
        expectedEdgesNum - the expected number of edges in the graph
        Returns:
        this builder
      • addHint

        Graph.Builder addHint​(Graph.Builder.Hint hint)
        Add a hint to this builder.

        Hints do not change the behavior of the graphs built by this builder, by may affect performance.

        Parameters:
        hint - the hint to add
        Returns:
        this builder
      • removeHint

        Graph.Builder removeHint​(Graph.Builder.Hint hint)
        Remove a hint from this builder.

        Hints do not change the behavior of the graphs built by this builder, by may affect performance.

        Parameters:
        hint - the hint to remove
        Returns:
        this builder
      • setOption

        default BuilderType setOption​(String key,
                                      Object value)
        [TL;DR Don't call me!] Set an option.

        The builder might support different options to customize its implementation. These options never change the behavior of the algorithm, only its internal implementation. The possible options are not exposed as 'public' because they are not part of the API and may change in the future.

        These options are mainly for debug and benchmark purposes.

        Parameters:
        key - the option key
        value - the option value
        Returns:
        this builder