Documentation ¶
Index ¶
- Variables
- type AdjLists
- func (a *AdjLists) AddEdge(n1, n2 *vertexes.Vertexes)
- func (a *AdjLists) AddNode(node *vertexes.Vertexes)
- func (a *AdjLists) Connected() bool
- func (a *AdjLists) Copy() AdjLists
- func (a *AdjLists) EdgeCount() int
- func (a *AdjLists) FirstNode() *vertexes.Vertexes
- func (a *AdjLists) Genus() int
- func (a *AdjLists) HamiltonianPaths(minLength int, stopOnFirstPath bool, includeReverse bool) [][]*vertexes.Vertexes
- func (a *AdjLists) HasNode(node vertexes.Vertexes) bool
- func (a *AdjLists) MinimalVertexCover() map[uint64]*vertexes.Vertexes
- func (a *AdjLists) NodeCount() int
- func (a *AdjLists) NodeWithMostEdges() *vertexes.Vertexes
- func (a *AdjLists) Nodes() map[uint64]*vertexes.Vertexes
- func (a *AdjLists) RemoveNode(node vertexes.Vertexes)
- func (a *AdjLists) RemoveOrphans()
- func (a *AdjLists) Serialize(title string) string
- func (a *AdjLists) ValueLowest() *vertexes.Vertexes
- func (a *AdjLists) ValueSum() int
- func (a *AdjLists) Whiskers() map[uint64]*vertexes.Vertexes
Constants ¶
This section is empty.
Variables ¶
var (
RunningID int64
)
Functions ¶
This section is empty.
Types ¶
type AdjLists ¶ added in v0.0.13
type AdjLists struct {
// contains filtered or unexported fields
}
AdjLists implements an undirected graph
func (*AdjLists) AddEdge ¶ added in v0.0.13
AddEdge adds an edge, adding the nodes if they are not already present
func (*AdjLists) AddNode ¶ added in v0.0.13
AddNode adds a node to the adjacency list if not already present
func (*AdjLists) Connected ¶ added in v0.0.13
Connected returns true if every vertex is reachable from every other vertex
func (*AdjLists) EdgeCount ¶ added in v0.0.13
EdgeCount returns the number of distinct edges in the adjacency list
func (*AdjLists) HamiltonianPaths ¶ added in v0.0.13
func (a *AdjLists) HamiltonianPaths(minLength int, stopOnFirstPath bool, includeReverse bool) [][]*vertexes.Vertexes
HamiltonianPaths returns paths, the traversal of which touch each vertex once
func (*AdjLists) HasNode ¶ added in v0.0.13
HasNode returns true if the node is already in the adjacency list
func (*AdjLists) MinimalVertexCover ¶ added in v0.0.13
MinimalVertexCover returns vertices that make a minimal (not guaranteed to be minimum) vertex cover
func (*AdjLists) NodeCount ¶ added in v0.0.13
NodeCount returns the number of nodes in the adjacency list
func (*AdjLists) NodeWithMostEdges ¶ added in v0.0.13
NodeWithMostEdges returns the node with the highest edge count
func (*AdjLists) RemoveNode ¶ added in v0.0.13
RemoveNode removes a node from the adjacency list
func (*AdjLists) RemoveOrphans ¶ added in v0.0.13
func (a *AdjLists) RemoveOrphans()
RemoveOrphans removes all vertices that have no edges
func (*AdjLists) Serialize ¶ added in v0.0.13
Serialize returns the adjacency list in graphviz format
func (*AdjLists) ValueLowest ¶ added in v0.0.13
ValueLowest returns the node with the lowest value