Coder Social home page Coder Social logo

redferret / jgraphs Goto Github PK

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

This package holds two Graph implementations, AdjacencyMatrix and AdjacencyList. There is also the option to upload a text file that will build and test each graph type.

Java 100.00%

jgraphs's Introduction

JGraphs

This package holds two Graph implementations, AdjacencyMatrix and AdjacencyList. There is also the option to upload a text file that will build and test each graph type.

The file format for building and testing the graph is as follows

---------------------------------------------------------------- Start of file

  • These are comments
  • These lines are skipped

begin

A B C D * Each must have a space between each vertex

A B * A goes to B B C * B goes to C C D * C goes to D

  • If the graph is weighted you need to specify the weight 'A B 10'

end

---------------------------------------------------------------- end of file

Here is an example from file RichardCG.txt

  • Author: Richard

weighted undirected

begin

  • Common Cities notice they don't have any spaces in their names Fort_Collins Denver Colorado_Springs Pueblo Boulder

  • Their connections and appox. distances Fort_Collins Denver 50 Fort_Collins Boulder 35 Denver Boulder 15 Denver Pueblo 80 Denver Colorado_Springs 55 Colorado_Springs Pueblo 25

end

isConnected ? addVertex Vail true addEdge Vail Denver 75 true hasEdge Denver Colorado_Springs ? hasEdge Pueblo Fort_Collins ?

The above tests have an expexted or ? unexpected outcome. If you ask 'true' it will test to see if it returns true, otherwise if you ask with a ? then it will print the answer.

jgraphs's People

Contributors

redferret avatar

Watchers

James Cloos avatar  avatar

Forkers

timmytian

jgraphs's Issues

isConnected not working correctly

Both representations are failing a simple connectivity test in the file "adjMatrixConnectionTest.txt"
It is expected that after deleting vertex C and adding an edge from A to D the graph should be connected but the output says it's not connected.

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.