Skip to content

Conversation

@srjpn
Copy link

@srjpn srjpn commented Oct 23, 2018

No description provided.

Sooraj Parameswaran added 20 commits January 23, 2016 09:41
Implemented hasEdgesBetween which gives boolean value according to the
presence of edge.

Also implemented addVertex which add the vertex and addEdge which
creates edge between two vertices as a part of implementing the basic
graph.
Implemented order method which gives the order of the graph.

It is the number of vertices in the graph.
Implemented size method which gives the size of the graph.

It is basically the number of edges in the graph.
Implemented pathBetween which returns a path between the given vertices.

There is no guarantee that the shortest or farthest will be returned.
Implemented farthestVertex which returns the farthest vertex from a
given vertex.
Implemented undirectedGraph which has all methods as directed graph with
a little changes in the methods.
Implemented allPaths which gives all the paths between two given
vertices.

It is working with dense graph also. But may need further optimisation.
Implemented all the methods that directed graph has to undirected graph.

All tests are passing.
Instead of repeating the prototype twice for each undirected and
directed graph, now i have created a graph object which has the methods
that are common for directed and undirected graphs. The additional
methods are added to the constructors seperately.
The size method in both directed and undirected graphs were similar
except one of them was returning the half of the caluculated value.

To avoid the repeatation of code twice, created numberOfEdges method in
graph and edited size method in directed and undirected graphs.
Implemented a simple shortestPath method in weightedGraph which gives
the shortest path between 2 given vertices in weightedGraph.

Also Implemented some necessary objects such as edge for the
weightedGraph.
Modified and refactored shortestPath of weightedGraph to work with the
graphs having loops.

A new test of dense graph is added to prove the working of shortestPath
on very complicated dense graph.
Modified dense graph test a little.

All tests are passing.
Instead of altering the array by adding a key called pathLength inside
the array, now it is using a object called Path.

Path is a simple object which has a path and length of tha path.

It can be further developed as per requirement.
Implemented and tested the shortestPath method of weightedGraph using
Digestra's algorithm.

Added more tests to check the working of algorithm with dense, complex
and multi graphs.
Refactored the weightedGraph object for common names such as edge,
weigth etc.
Instead of having basic graph in graphs module, now it is in differnt
module which can be required by other modules to use basic graph.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant