GithubHelp home page GithubHelp logo

gnp / graphscala Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 104 KB

Classes for working with Graphs. Just a start really to explore an idea of custom operators for graph construction.

License: Apache License 2.0

Scala 100.00%

graphscala's Introduction

README

GraphScala contains code you can use to construct graphs.

import org.exoprax.graph.Graph2._

val triple = 1 -- 2 -> 3 // Represents an edge from Node 1 to Node 3 with annotation 2
val g1 = Graph2(1 -> 2, 2 -> 3, 3 -> 1) // Cycle from Node 1 to Node 2 to Node 3 and back to Node 1
val g2 = Graph2(1 -> 2 -> 3) // Graph with two nodes: the Tuple (1, 2) and the Number 3. One edge from (1, 2) to 3
val g3 = Graph2(1 -- 2 -> 3) // Graph with two Nodes: 1 and 3, and an edge from Node 1 to Node 3 with annotation 2
val g4 = Graph2("A" -> 2) // Graph with two Nodes: String "A" and Integer 2
val g5 = Graph2("Z")  // Graph with one Node and no Edges
val g6 = Graph2("Z", "A" -> 2, 42) Graph with four Nodes: "Z", "A", 2 and 42 and one Edge (from "A" to 2)
val g7 = Graph2("A", "A" -> "C", "B", "B" -- 14 -> "D")

graphscala's People

Stargazers

Gregor Purdy avatar

Watchers

Gregor Purdy avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.