- java.lang.Object
-
- org.logicng.graphs.datastructures.Hypergraph<T>
-
- Type Parameters:
T- the content type of the graph's nodes
public final class Hypergraph<T> extends Object
A simple data structure for a hypergraph.- Since:
- 1.4.0
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description Hypergraph()Constructs a new hypergraph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(Collection<HypergraphNode<T>> nodes)Adds an edges to the hypergraph.voidaddEdge(HypergraphEdge<T> edge)Adds an edge to the hypergraph.voidaddEdge(HypergraphNode<T>... nodes)Adds an edges to the hypergraph.voidaddEdges(Collection<HypergraphEdge<T>> edges)Adds a set of edges to the hypergraph.Set<HypergraphEdge<T>>edges()Returns the set of edges of the hypergraph.Set<HypergraphNode<T>>nodes()Returns the set of nodes of the hypergraph.StringtoString()
-
-
-
Method Detail
-
nodes
public Set<HypergraphNode<T>> nodes()
Returns the set of nodes of the hypergraph.- Returns:
- the set of nodes of the hypergraph
-
edges
public Set<HypergraphEdge<T>> edges()
Returns the set of edges of the hypergraph.- Returns:
- the set of edges of the hypergraph
-
addEdge
public void addEdge(HypergraphEdge<T> edge)
Adds an edge to the hypergraph.- Parameters:
edge- the edge
-
addEdge
public void addEdge(Collection<HypergraphNode<T>> nodes)
Adds an edges to the hypergraph. The edge is represented by its connected nodes.- Parameters:
nodes- the nodes of the edge
-
addEdge
@SafeVarargs public final void addEdge(HypergraphNode<T>... nodes)
Adds an edges to the hypergraph. The edge is represented by its connected nodes.- Parameters:
nodes- the nodes of the edge
-
addEdges
public void addEdges(Collection<HypergraphEdge<T>> edges)
Adds a set of edges to the hypergraph.- Parameters:
edges- the edges
-
-