Module logicng

Class HypergraphNode<T>

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

    public final class HypergraphNode<T>
    extends Object
    A node in a hypergraph.
    Since:
    1.4.0
    Version:
    2.0.0
    • Constructor Detail

      • HypergraphNode

        public HypergraphNode​(Hypergraph<T> graph,
                              T content)
        Constructs a new hypergraph node for a given graph and content.
        Parameters:
        graph - the graph for this node
        content - the content of this node
    • Method Detail

      • graph

        public Hypergraph<T> graph()
        Returns the hypergraph of this node.
        Returns:
        the hypergraph of this node
      • content

        public T content()
        Returns the content of this node.
        Returns:
        the content of this node
      • edges

        public Set<HypergraphEdge<T>> edges()
        Returns the edges which are connected with this node.
        Returns:
        the edges which are connected with this node
      • addEdge

        public void addEdge​(HypergraphEdge<T> edge)
        Adds an edge to this node.
        Parameters:
        edge - the edge
      • computeTentativeNewLocation

        public double computeTentativeNewLocation​(Map<HypergraphNode<T>,​Integer> nodeOrdering)
        Computes the tentative new location for this node (see Aloul, Markov, and Sakallah).
        Parameters:
        nodeOrdering - the node ordering for which the COG is computed
        Returns:
        the tentative new location for this node
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object