Module logicng

Class HypergraphEdge<T>

  • Type Parameters:
    T - the content type of the graph's nodes

    public final class HypergraphEdge<T>
    extends Object
    An edge in a hypergraph.
    Since:
    1.4.0
    Version:
    2.0.0
    • Constructor Detail

      • HypergraphEdge

        public HypergraphEdge​(Collection<HypergraphNode<T>> nodes)
        Constructs a new edge for a given set of nodes.
        Parameters:
        nodes - the nodes connected by this edge
      • HypergraphEdge

        @SafeVarargs
        public HypergraphEdge​(HypergraphNode<T>... nodes)
        Constructs a new edge for a given set of nodes.
        Parameters:
        nodes - the nodes connected by this edge
    • Method Detail

      • nodes

        public Set<HypergraphNode<T>> nodes()
        Returns the nodes connected by this edge.
        Returns:
        the nodes connected by this edge
      • centerOfGravity

        public double centerOfGravity​(Map<HypergraphNode<T>,​Integer> nodeOrdering)
        Computes the center of gravity for this edge (see Aloul, Markov, and Sakallah).
        Parameters:
        nodeOrdering - the node ordering for which the COG is computed
        Returns:
        the center of gravity for this edge
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object