Skip to content

stoneliuCS/graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Generic Graph Library Written in Go

Algorithms that require graphs are very common. This is a generic graph library that enables many useful features with its core design philosophy to be functional.

.
├── cmd
│   └── graph
│       └── main.go
├── go.mod
├── go.sum
├── graph_gui.go
├── graph_test.go
├── graph.go
└── README.md

3 directories, 7 files

Main Functionalities

The goal of this library is to create a generic graph API with a bunch of useful (and commonly) needed functionalities these include

  • DFS Depth First Search, enables traversing the graph in a DFS manner.
  • BFS Breadth First Search, enables traversing the graph in a BFS manner.
  • Map MapGraph, enables mapping/translating a graph of type X to a graph of type Y.
  • Filter FilterGraph, enables filtering of edges on this graph by a specific predicate.
  • Cycle Detection ContainsCycle determines if a graph contains a cycle.

API Design

Every single method and function available in graph is pure and functional. Meaning that the resulting method application does not change the underlying graph, instead it returns a new graph underneath. HOWEVER, this does not gurantee that mutable data types will not be cloned.

Graphics Support

Under the hood, graph uses Gio to render graph GUIs. If you wish to use the GUI methods available please install

go install gioui.org/cmd/gogio@latest

About

Generic Graph Library In Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages