public class Subgraph extends Object
PlanarGraph.
A subgraph may contain any subset of Edges
from the parent graph.
It will also automatically contain all DirectedEdges
and Nodes associated with those edges.
No new objects are created when edges are added -
all associated components must already exist in the parent graph.| Constructor and Description |
|---|
Subgraph(PlanarGraph parentGraph)
Creates a new subgraph of the given
PlanarGraph |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Edge e)
Adds an
Edge to the subgraph. |
boolean |
contains(Edge e)
Tests whether an
Edge is contained in this subgraph |
Iterator |
dirEdgeIterator()
Returns an
Iterator over the DirectedEdges in this graph,
in the order in which they were added. |
Iterator |
edgeIterator()
|
PlanarGraph |
getParent()
Gets the
PlanarGraph which this subgraph
is part of. |
Iterator |
nodeIterator()
|
public Subgraph(PlanarGraph parentGraph)
PlanarGraphparentGraph - the parent graphpublic PlanarGraph getParent()
PlanarGraph which this subgraph
is part of.public void add(Edge e)
e - the edge to addpublic Iterator dirEdgeIterator()
Iterator over the DirectedEdges in this graph,
in the order in which they were added.add(Edge)public Iterator nodeIterator()
Copyright © 2024. All rights reserved.