Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSubgraphHasNode ¶
A faster alternative to GetSubgraph(graph, start).HasNode(target)
func GetSubgraphNodeCount ¶
A faster alternative to GetSubgraph(graph, start).GetNodeCount()
func ToString ¶
Return graphviz string representation, we can output this to file and preview in eg. xdot or any other tool for graphviz
func TopologicalSort ¶
Types ¶
type Attributes ¶
type ByNodePriority ¶
type ByNodePriority struct {
// contains filtered or unexported fields
}
func (ByNodePriority) Len ¶
func (a ByNodePriority) Len() int
func (ByNodePriority) Less ¶
func (a ByNodePriority) Less(i, j int) bool
func (ByNodePriority) Swap ¶
func (a ByNodePriority) Swap(i, j int)
type Graph ¶
type Graph interface { GetNodeCount() int GetName() string HasNode(id string) bool HasEdge(source, target string) bool GetNodes() []string SetNodeProperty(id, key, value string) SetNodeAttributes(id string, attributes Attributes) SetNodeBackgroundColor(id, color string) GetNodeAttributes(id string) (Attributes, error) Merge(mergeGraph Graph) GetNodePriority(id string) (int, error) SetNodePriority(id string, priority int) error // return false if the node already present in the graph AddNode(id string) bool // return true if successfully removed from graph DeleteNode(id string) bool CutSubgraph(root string) // Removes node in this way that will keep connected parents to children of the node // eg. A -> B -> C, if we remove B then we will get A -> C DeleteProxyNode(id string) // Remove an edge, and replicate the outgoing connections of the target node onto the source node. // The edge being removed is a proxy for these connections. This is similar to DeleteProxyNode, but only deletes one of the incoming edges. DeleteProxyEdge(source, target string) // DeleteProxyEdge for edges that have a particular color DeleteProxyEdges(color string) // Like DeleteProxyEdge but additionally set edge color to replicate ones DeleteProxyEdgeSetColor(source, proxy, color string) GetEdgeAttributes(source, target string) (Attributes, error) SetEdgeAttributes(source, target string, attributes Attributes) bool AddEdge(source, target string) bool AddEdgeToExistingNodes(source, target string) (bool, error) SetEdgeColor(source, target string, color string) SetEdgeWeight(source, target string, weight int) SetEdgeConstraint(source, target string, constraint bool) SetEdgeProperty(source, target, key, value string) DeleteEdge(source, target string) error // GetSources returns the list of parent Nodes. // (Nodes that come towards the argument vertex.) GetSources(id string) ([]string, error) // GetTargets returns the list of child Nodes. // (Nodes that go out of the argument vertex.) GetTargets(id string) ([]string, error) IsReachable(source, target string) bool // contains filtered or unexported methods }
func GetSubgraph ¶
A subgraph of a graph G is another graph formed from a subset of the vertices and edges of G. The vertex subset must include all endpoints of the edge subset. subgraph: https://en.wikipedia.org/wiki/Glossary_of_graph_theory_terms#subgraph
func GetSubgraphs ¶
Retrive all possible SubGraphs. Check GetSubGraph to understand what is sub graph
Click to show internal directories.
Click to hide internal directories.