Documentation
¶
Index ¶
- type DAG
- func (d *DAG) AddEdge(edge core.Edge) error
- func (d *DAG) AddNode(node core.Node) error
- func (d *DAG) ConnectNode(node1, node2 core.Node) error
- func (d *DAG) Edges() []core.Edge
- func (d *DAG) FindEdgeById(edgeId string) (core.Edge, bool)
- func (d *DAG) FindNodeById(nodeId string) (core.Node, bool)
- func (d *DAG) GetPredecessors(nodeID string) []*Edge
- func (d *DAG) GetSuccessors(nodeID string) []*Edge
- func (d *DAG) Nodes() []core.Node
- func (d *DAG) TopologicalSort() ([]core.Node, error)
- func (d *DAG) ValidateComplete() error
- func (d *DAG) ValidateConnectivity() error
- func (d *DAG) ValidateDAG() error
- func (d *DAG) ValidateNoSelfLoops() error
- func (d *DAG) ValidateNodeReferences() error
- type Edge
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 有向无环图的实现
func (*DAG) ConnectNode ¶
ConnectNode 连接两个节点
func (*DAG) FindEdgeById ¶
FindEdgeById 根据ID查找边
func (*DAG) FindNodeById ¶
FindNodeById 根据ID查找节点
func (*DAG) GetPredecessors ¶
GetPredecessors 获取节点的前驱边
func (*DAG) GetSuccessors ¶
GetSuccessors 获取节点的后继边
func (*DAG) TopologicalSort ¶
TopologicalSort 返回拓扑排序后的节点列表
func (*DAG) ValidateConnectivity ¶
ValidateConnectivity 验证图的连通性
func (*DAG) ValidateNoSelfLoops ¶
ValidateNoSelfLoops 验证没有自环
func (*DAG) ValidateNodeReferences ¶
ValidateNodeReferences 验证节点引用的一致性
Click to show internal directories.
Click to hide internal directories.