Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDuplicateVertex indicates that a vertex with an // identical id exists in the DAG. ErrDuplicateVertex = errors.New("vertex already exists") // ErrVertexNoExist indicates that an id does not correspond // to a vertex in the DAG. ErrVertexNoExist = errors.New("vertex does not exist") // ErrCycle indicates that there is a cycle within the graph ErrCycle = errors.New("cycle exists") )
Functions ¶
This section is empty.
Types ¶
type DAG ¶
type DAG struct {
// contains filtered or unexported fields
}
DAG represents a Directed Acyclic Graph.
func (*DAG) AddVertex ¶
AddVertex will add a vertex to the DAG with the adjacent parent verticies. Edges are assumed to travel from parents to children. If a vertex already exists, an error will be returned
Click to show internal directories.
Click to hide internal directories.