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
tasks
is emptyDeclaration
Swift
public init()
-
Add a task to the graph
Declaration
Swift
public func addTask(_ task: TaskNode)
Parameters
task
the task to be added
Return Value
void
-
Add a successor task to the current (source) task. This method adds an
Edge
between the two tasks.Parameters
source
the task in which a successor is added
neighbor
the successor task for the source task
Return Value
void
-
Add a predecessor task to the current (source) task. This method adds an
Edge
between the two tasks.Parameters
source
the task in which a predecessor is added
neighbor
the predecessor task for the source task
Return Value
void