- java.lang.Object
-
- org.logicng.graphs.datastructures.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 Summary
Constructors Constructor Description HypergraphNode(Hypergraph<T> graph, T content)Constructs a new hypergraph node for a given graph and content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(HypergraphEdge<T> edge)Adds an edge to this node.doublecomputeTentativeNewLocation(Map<HypergraphNode<T>,Integer> nodeOrdering)Computes the tentative new location for this node (see Aloul, Markov, and Sakallah).Tcontent()Returns the content of this node.Set<HypergraphEdge<T>>edges()Returns the edges which are connected with this node.booleanequals(Object o)Hypergraph<T>graph()Returns the hypergraph of this node.inthashCode()StringtoString()
-
-
-
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 nodecontent- 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
-
-