MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Graph

Struct Graph

graph/graph.go:9–13  ·  view source on GitHub ↗

Graph provides a structure to store the graph. It is safe to use its empty object.

Source from the content-addressed store, hash-verified

7// Graph provides a structure to store the graph.
8// It is safe to use its empty object.
9type Graph struct {
10 vertices int
11 edges map[int]map[int]int // Stores weight of an edge
12 Directed bool // Differentiate directed/undirected graphs
13}
14
15// Constructor functions for graphs (undirected by default)
16func New(v int) *Graph {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected