PCGDirectedGraph Class Reference
| Inherits from | NSObject |
| Declared in | PCGDirectedGraph.h PCGDirectedGraph.m |
Overview
The PCGDirectedGraph class is an implementation of a weighted directed graph (or weighted digraph, or network).
Definition
See http://en.wikipedia.org/wiki/Directed_graph for directed graph theory.
Thread
This class is not thread safe.
Tasks
Initialization
Adding vertices
Removing vertices
Adding edges
-
– addEdgesBetweenVertex:andVertex: -
– addEdgeFromVertex:toVertex: -
– addEdgesBetweenVertex:andVertex:withWeight: -
– addEdgeFromVertex:toVertex:withWeight:
Removing edges
Class Methods
directedGraph
Creates, initialises and returns an empty PCGDirectedGraph object with default capacity.
+ (instancetype)directedGraphReturn Value
an empty PCGDirectedGraph
Declared In
PCGDirectedGraph.hdirectedGraphWithCapacity:
Creates, initialises and returns an empty PCGDirectedGraph object with the specified capacity.
+ (instancetype)directedGraphWithCapacity:(NSUInteger)capacityParameters
- capacity
the initial vertices container capacity
Return Value
an empty PCGDirectedGraph
Declared In
PCGDirectedGraph.hInstance Methods
addEdgeFromVertex:toVertex:
Add or replace an edge from source to target vertices, with weight of 1,
adding source and target vertices if they do not exist in this graph.
- (void)addEdgeFromVertex:(PCGVertex)source toVertex:(PCGVertex)targetParameters
- source
The source vertex
- target
The target vertex
Declared In
PCGDirectedGraph.haddEdgeFromVertex:toVertex:withWeight:
Add or replace an edge from source to target vertices, with the specified weight,
adding source and target vertices if they do not exist in this graph.
- (void)addEdgeFromVertex:(PCGVertex)source toVertex:(PCGVertex)target withWeight:(NSUInteger)weightParameters
- source
The source vertex
- target
The target vertex
- weight
The weight of the edge
Declared In
PCGDirectedGraph.haddEdgesBetweenVertex:andVertex:
Add or replace an edge from source to target vertices and then from target to source, both edges with weight of 1,
adding source and target vertices if they do not exist in this graph.
- (void)addEdgesBetweenVertex:(PCGVertex)source andVertex:(PCGVertex)targetParameters
- source
The source vertex
- target
The target vertex
Declared In
PCGDirectedGraph.haddEdgesBetweenVertex:andVertex:withWeight:
Add or replace an edge from source to target vertices and then from target to source, both edges with the specified weight,
adding source and target vertices if they do not exist in this graph.
- (void)addEdgesBetweenVertex:(PCGVertex)source andVertex:(PCGVertex)target withWeight:(NSUInteger)weightDeclared In
PCGDirectedGraph.haddVertex:
Add vertex source if it does not exist in this graph.
- (void)addVertex:(PCGVertex)sourceParameters
- source
The source vertex
Declared In
PCGDirectedGraph.hinit
Initialises and returns an empty PCGDirectedGraph object with default capacity.
- (instancetype)initReturn Value
an empty PCGDirectedGraph
Declared In
PCGDirectedGraph.hinitWithCapacity:
Initialises and returns an empty PCGDirectedGraph object with the specified capacity.
- (instancetype)initWithCapacity:(NSUInteger)capacityParameters
- capacity
the initial vertices container capacity
Return Value
an empty PCGDirectedGraph
Declared In
PCGDirectedGraph.hremoveEdgeFromVertex:toVertex:
Remove edge if it exists in this graph from source to target vertices.
- (void)removeEdgeFromVertex:(PCGVertex)source toVertex:(PCGVertex)targetParameters
- source
The source vertex
- target
The target vertex
Declared In
PCGDirectedGraph.hremoveEdgesBetweenVertex:andVertex:
Remove edges if they exists in this graph between source and target vertices.
- (void)removeEdgesBetweenVertex:(PCGVertex)source andVertex:(PCGVertex)targetParameters
- source
The source vertex
- target
The target vertex
Declared In
PCGDirectedGraph.hremoveEdgesFromVertex:
Remove edges if they exists in this graph going from source vertex to any vertices.
- (void)removeEdgesFromVertex:(PCGVertex)sourceParameters
- source
The source vertex
Declared In
PCGDirectedGraph.hremoveEdgesToVertex:
Remove edges if they exists in this graph going from any vertices to target vertex.
- (void)removeEdgesToVertex:(PCGVertex)targetParameters
- target
The target vertex
Declared In
PCGDirectedGraph.hremoveVertex:
Remove vertex source if it exists in this graph, removing also all edges going from and to it.
- (void)removeVertex:(PCGVertex)sourceParameters
- source
The source vertex
Declared In
PCGDirectedGraph.h