Documentation
¶
Index ¶
- type DAG
- func (d *DAG) AddEdge(tailVertex *Vertex, headVertex *Vertex) error
- func (d *DAG) AddVertex(v *Vertex) error
- func (d *DAG) DeleteEdge(tailVertex *Vertex, headVertex *Vertex) error
- func (d *DAG) DeleteVertex(vertex *Vertex) error
- func (d *DAG) GetVertex(id interface{}) (*Vertex, error)
- func (d *DAG) Order() int
- func (d *DAG) Predecessors(vertex *Vertex) ([]*Vertex, error)
- func (d *DAG) SinkVertices() []*Vertex
- func (d *DAG) Size() int
- func (d *DAG) SourceVertices() []*Vertex
- func (d *DAG) String() string
- func (d *DAG) Successors(vertex *Vertex) ([]*Vertex, error)
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAG ¶
type DAG struct {
// contains filtered or unexported fields
}
DAG type implements a Directed Acyclic Graph data structure.
func (*DAG) DeleteEdge ¶
DeleteEdge deletes a directed edge between two existing vertices from the graph.
func (*DAG) DeleteVertex ¶
DeleteVertex deletes a vertex and all the edges referencing it from the graph.
func (*DAG) Predecessors ¶
Predecessors return vertices that are parent of a given vertex.
func (*DAG) SinkVertices ¶
SinkVertices return vertices with no children defined by the graph edges.
func (*DAG) SourceVertices ¶
SourceVertices return vertices with no parent defined by the graph edges.
type Vertex ¶
Vertex type implements a vertex of a Directed Acyclic graph or DAG.
func (*Vertex) InDegree ¶
InDegree return the number of parents of the vertex or the number of edges entering on it.
Click to show internal directories.
Click to hide internal directories.