Package org.tweetyproject.graphs
Interface GeneralGraph<T extends Node>
- Type Parameters:
T- the type of nodes in the graph, which extends the `Node` class.
- All Superinterfaces:
Iterable<T>
- All Known Subinterfaces:
AbstractDialecticalFramework,DirHyperGraph<T>,Graph<T>
- All Known Implementing Classes:
AbstractBipolarFramework,AbstractEAFTheory,ArgumentTree,BpmnModel,ClaimBasedTheory,Compilation,DeductiveArgumentationFramework,DefaultGraph,DungTheory,EAFTheory,EvidentialArgumentationFramework,ExecutableDungTheory,HyperGraph,IncompleteTheory,InducedTheory,NamedPEAFTheory,NecessityArgumentationFramework,PEAFTheory,PerceivableStructuredArgumentationFramework,PetriNet,ProbabilisticArgumentationFramework,ReachabilityGraph,SerialisationGraph,SetAf,SimpleGraph,SocialAbstractArgumentationFramework,StructuredArgumentationFramework,WeightedArgumentationFramework,WeightedDungTheory
The `GeneralGraph` interface represents a general structure for graphs where each graph
consists of nodes and edges. This interface provides methods for retrieving nodes,
edges, and subgraphs (restrictions of the graph).
The `GeneralGraph` interface is parameterized with the type `T`, which extends `Node`. This allows for flexibility in defining different types of graphs with specific types of nodes.
- Author:
- Sebastian Franke
-
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends GeneralEdge<? extends T>> getEdges()Returns the edges of this graph.getNodes()Returns the nodes of this graph.getRestriction(Collection<T> nodes) Returns a copy of this graph that contains only the specified nodes and all corresponding edges between them.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getRestriction
Returns a copy of this graph that contains only the specified nodes and all corresponding edges between them.This method generates a subgraph (or restricted graph) from the current graph by including only the given nodes and the edges that connect them. The returned graph is a new instance and does not modify the original graph.
- Parameters:
nodes- a collection of nodes to be included in the restricted graph.- Returns:
- a `GeneralGraph` object representing the restricted graph.
-
getNodes
Collection<T> getNodes()Returns the nodes of this graph.This method retrieves all nodes that are part of the current graph.
- Returns:
- a collection of nodes in the graph.
-
getEdges
Collection<? extends GeneralEdge<? extends T>> getEdges()Returns the edges of this graph.This method retrieves all edges that are part of the current graph. The edges returned are of the type `GeneralEdge`, which is parameterized by the type of nodes in the graph.
- Returns:
- a collection of edges in the graph.
-