Graph
public class Graph : Equatable
The class to represent a graph
-
All the tasks in the graph
Declaration
Swift
public var tasks: [TaskNode] -
Initialize an empty graph
tasksis emptyDeclaration
Swift
public init() -
Add a task to the graph
Declaration
Swift
public func addTask(_ task: TaskNode)Parameters
taskthe task to be added
Return Value
void
-
Add a successor task to the current (source) task. This method adds an
Edgebetween the two tasks.Parameters
sourcethe task in which a successor is added
neighborthe successor task for the source task
Return Value
void
-
Add a predecessor task to the current (source) task. This method adds an
Edgebetween the two tasks.Parameters
sourcethe task in which a predecessor is added
neighborthe predecessor task for the source task
Return Value
void
View on GitHub
Graph Class Reference