Skip to content
/ graph Public

A Go library for creating and manipulating graph structures.

License

Notifications You must be signed in to change notification settings

sixafter/graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

graph

CI Go Quality Gate Status GitHub issues Go Reference Go Report Card License: Apache 2.0 CodeQL

A Go library for creating and manipulating graph data structures.

Features

This Go-based graph library is designed for versatility, performance, and extensibility, leveraging generics to handle various graph-related operations seamlessly. Key features include:

  • Generics-Based Design: Leverages Go generics for a flexible and type-safe graph interface supporting custom vertex and edge types.
  • Trait-Driven Configuration: Supports traits such as directed/undirected, weighted, acyclic, rooted, and multigraph properties.
  • Comprehensive Graph Operations: Provides efficient algorithms for CRUD operations, set operations, adjacency/predecessor maps, and graph cloning.
  • Traversal and Pathfinding: Implements breadth-first, depth-first, and shortest-path algorithms. Supports minimum and maximum spanning tree computation.
  • Graph Metrics: Offers centrality measures (degree, closeness, betweenness, eigenvector), clustering coefficients, density, diameter, and average path length.
  • Community and Ranking Analysis: Includes modularity and PageRank calculations for advanced graph analysis.
  • Cycle Management: Prevents cycles in acyclic graphs during edge additions.
  • Streaming Support: Enables paginated streaming of vertices and edges with context management for cancellation and resumption.
  • Customizable Input/Output: Supports flexible graph serialization and custom reader/writer implementations.
  • Concurrency Safe: Designed for thread-safe operations in multi-threaded environments.
  • Lightweight and Efficient: Optimized for high performance with minimal overhead.
  • Zero Dependencies: Lightweight implementation with no external dependencies beyond the standard library.
  • Supports io.Reader Interface:
    • Graph Serialization: Export and import graphs to/from various formats for interoperability.
    • Customizable Readers and Writers: Create tailored I/O operations for graph persistence.

Installation

Using go get

To install this package, run the following command:

go get -u github.com/sixafter/graph

To use the package in your Go project, import it as follows:

import "github.com/sixafter/graph"

Contributing

Contributions are welcome. See CONTRIBUTING


License

This project is licensed under the Apache 2.0 License. See LICENSE file.

About

A Go library for creating and manipulating graph structures.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages