New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/sebogh/dag

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sebogh/dag

  • v0.1.4
  • Source
  • Go
  • Socket score

Version published
Created
Source

dag

GoDoc

Yet another directed acyclic graph (DAG) implementation in golang.

Quickstart


// data structure that will be used as vertex in the graph
type myVertex struct {
	Label string
}

// implement the Vertex interface 
func (v myVertex) String() string {
	return v.Label
}


func main() {

    // initialize a new graph
    dag := NewDAG()

    // init three vertices
    var v1 Vertex = myVertex{"1"}
    var v2 Vertex = myVertex{"2"}
    var v3 Vertex = myVertex{"3"}

    // add the above vertices and connect them with two edges
	_ = dag.AddEdge(&v1, &v2)
	_ = dag.AddEdge(&v1, &v3)

    // get children of &v1 -> set (map to bool) containing &v2 and &v3
    children, _ := dag.GetChildren(&v1)
}

FAQs

Package last updated on 25 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc