Documentation
¶
Index ¶
- type Edge
- type Graph
- func (g *Graph) AddEdge(source, target *Vertex, weight int)
- func (g *Graph) AddVertex(value any) *Vertex
- func (g *Graph) BellmanFord(source *Vertex) (map[*Vertex]int, map[*Vertex]*Vertex, bool)
- func (g *Graph) BreadthFirstSearch()
- func (g *Graph) DepthFirstSearch()
- func (g *Graph) Dijkstra(source *Vertex)
- func (g *Graph) Display()
- func (g *Graph) FloydWarshall() (map[*Vertex]map[*Vertex]int, map[*Vertex]map[*Vertex]*Vertex)
- func (g *Graph) IsBipartite() bool
- func (g *Graph) IsCaterpillar() bool
- func (g *Graph) IsComplete() bool
- func (g *Graph) IsCompleteBipartite() bool
- func (g *Graph) IsConnected() bool
- func (g *Graph) IsCycle() bool
- func (g *Graph) IsCyclic() bool
- func (g *Graph) IsEquitable() bool
- func (g *Graph) IsEulerian() bool
- func (g *Graph) IsForest() bool
- func (g *Graph) IsGrid() bool
- func (g *Graph) IsHamiltonian() bool
- func (g *Graph) IsIsogonal(other *Graph) bool
- func (g *Graph) IsIsometric(other *Graph) bool
- func (g *Graph) IsIsomorphic(other *Graph) bool
- func (g *Graph) IsLadder() bool
- func (g *Graph) IsMinor(other *Graph) bool
- func (g *Graph) IsPath() bool
- func (g *Graph) IsPlanar() bool
- func (g *Graph) IsRegular() bool
- func (g *Graph) IsStar() bool
- func (g *Graph) IsStronglyConnected() bool
- func (g *Graph) IsSubdivision(other *Graph) bool
- func (g *Graph) IsSubgraph(other *Graph) bool
- func (g *Graph) IsTree() bool
- func (g *Graph) IsWheel() bool
- func (g *Graph) Kruskal() (map[*Vertex]*Vertex, int)
- func (g *Graph) Prim() (map[*Vertex]*Vertex, int)
- func (g *Graph) TopologicalSort() []any
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
Vertices []*Vertex
}
Graph represents a graph data structure
func (*Graph) BellmanFord ¶
BellmanFord performs the Bellman-Ford algorithm on the graph
func (*Graph) BreadthFirstSearch ¶
func (g *Graph) BreadthFirstSearch()
BreadthFirstSearch performs a breadth-first search on the graph
func (*Graph) DepthFirstSearch ¶
func (g *Graph) DepthFirstSearch()
DepthFirstSearch performs a depth-first search on the graph
func (*Graph) FloydWarshall ¶
FloydWarshall performs the Floyd-Warshall algorithm on the graph
func (*Graph) IsBipartite ¶
IsBipartite checks if the graph is bipartite
func (*Graph) IsCaterpillar ¶
IsCaterpillar checks if the graph is a caterpillar graph
func (*Graph) IsComplete ¶
IsComplete checks if the graph is complete
func (*Graph) IsCompleteBipartite ¶
IsCompleteBipartite checks if the graph is a complete bipartite graph
func (*Graph) IsConnected ¶
IsConnected checks if the graph is connected
func (*Graph) IsEquitable ¶
IsEquitable checks if the graph is equitable
func (*Graph) IsEulerian ¶
IsEulerian checks if the graph is Eulerian
func (*Graph) IsHamiltonian ¶
IsHamiltonian checks if the graph is Hamiltonian
func (*Graph) IsIsogonal ¶
IsIsogonal checks if the graph is isogonal to another graph
func (*Graph) IsIsometric ¶
IsIsometric checks if the graph is isometric to another graph
func (*Graph) IsIsomorphic ¶
IsIsomorphic checks if the graph is isomorphic to another graph
func (*Graph) IsStronglyConnected ¶
IsStronglyConnected checks if the graph is strongly connected
func (*Graph) IsSubdivision ¶
IsSubdivision checks if the graph is a subdivision of another graph
func (*Graph) IsSubgraph ¶
IsSubgraph checks if the graph is a subgraph of another graph
func (*Graph) TopologicalSort ¶
func (g *Graph) TopologicalSort() []any
TopologicalSort performs a topological sort on the graph