Documentation ¶
Index ¶
- type Graph
- type Network
- func (n *Network) Add(id int64) error
- func (n *Network) CheckReachability(src, dst int64) (bool, error)
- func (n *Network) Connect(srcID, dstID int64, duration float64) error
- func (n *Network) Get(elementID int64) (nodeID int64, ok bool)
- func (n *Network) ValidatePath(p []int64) (valid bool, reason error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
*simple.WeightedDirectedGraph
}
Graph is always a weighted directed graph
func NewGraph ¶
func NewGraph() *Graph
NewGraph must be used to initialize a graph. self pointing edges (loops) are not allowed and considered with infinite weight. The weight of a non existent edge is infinite.
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network is a graph of elements
func (*Network) CheckReachability ¶
CheckReachability checks if you can reach dst from src.
func (*Network) Connect ¶
Connect marks dst as reachable from src. returns error if src or dst are nil.
Click to show internal directories.
Click to hide internal directories.