Class BipartiteMatchingProblem.BipartiteMatchingProblemImpl<V,​E>

  • Type Parameters:
    V - the graph vertex type
    E - the graph edge type
    All Implemented Interfaces:
    BipartiteMatchingProblem<V,​E>
    Enclosing interface:
    BipartiteMatchingProblem<V,​E>

    public static class BipartiteMatchingProblem.BipartiteMatchingProblemImpl<V,​E>
    extends java.lang.Object
    implements BipartiteMatchingProblem<V,​E>
    Default implementation of a Bipartite Matching Problem
    • Constructor Summary

      Constructors 
      Constructor Description
      BipartiteMatchingProblemImpl​(Graph<V,​E> graph, java.util.Set<V> partition1, java.util.Set<V> partition2, java.util.function.Function<E,​java.lang.Double> costs, boolean weighted)
      Constructs a new bipartite matching problem
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.function.Function<E,​java.lang.Double> getCosts()
      Returns a cost function of this problem.
      Graph<V,​E> getGraph()
      Returns the graph, which defines the problem
      java.util.Set<V> getPartition1()
      Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)
      java.util.Set<V> getPartition2()
      Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)
      boolean isWeighted()
      Determines if this problem is weighted or not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BipartiteMatchingProblemImpl

        public BipartiteMatchingProblemImpl​(Graph<V,​E> graph,
                                            java.util.Set<V> partition1,
                                            java.util.Set<V> partition2,
                                            java.util.function.Function<E,​java.lang.Double> costs,
                                            boolean weighted)
        Constructs a new bipartite matching problem
        Parameters:
        graph - a graph, which defines the problem
        partition1 - one of the partitions of the graph
        partition2 - one of the partitions of the graph
        costs - problem cost function
        weighted - is the problem is weighted or not
    • Method Detail

      • getGraph

        public Graph<V,​E> getGraph()
        Returns the graph, which defines the problem
        Specified by:
        getGraph in interface BipartiteMatchingProblem<V,​E>
        Returns:
        the graph, which defines the problem
      • getCosts

        public java.util.function.Function<E,​java.lang.Double> getCosts()
        Returns a cost function of this problem. This function must be defined for all edges of the graph. In the case the problem is unweighted, the function must return any constant value for all edges.
        Specified by:
        getCosts in interface BipartiteMatchingProblem<V,​E>
        Returns:
        a cost function of this problem
      • getPartition1

        public java.util.Set<V> getPartition1()
        Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)
        Specified by:
        getPartition1 in interface BipartiteMatchingProblem<V,​E>
        Returns:
        one of the 2 partitions of the graph
      • getPartition2

        public java.util.Set<V> getPartition2()
        Returns one of the 2 partitions of the graph (no 2 vertices in this set share an edge)
        Specified by:
        getPartition2 in interface BipartiteMatchingProblem<V,​E>
        Returns:
        one of the 2 partitions of the graph
      • isWeighted

        public boolean isWeighted()
        Determines if this problem is weighted or not.
        Specified by:
        isWeighted in interface BipartiteMatchingProblem<V,​E>
        Returns:
        true is the problem is weighted, false otherwise