- java.lang.Object
-
- org.logicng.graphs.datastructures.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 Summary
Constructors Constructor Description HypergraphEdge(Collection<HypergraphNode<T>> nodes)Constructs a new edge for a given set of nodes.HypergraphEdge(HypergraphNode<T>... nodes)Constructs a new edge for a given set of nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecenterOfGravity(Map<HypergraphNode<T>,Integer> nodeOrdering)Computes the center of gravity for this edge (see Aloul, Markov, and Sakallah).booleanequals(Object o)inthashCode()Set<HypergraphNode<T>>nodes()Returns the nodes connected by this edge.StringtoString()
-
-
-
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
-
-