Skip to content

sethrem/graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graph Build Status

Graph traversal and optimization framework.

Examples

Vertex Addition

Graph<Vertex> graph = Graphs.newEmptyGraph();
Vertex vertex = new Vertex();
graph.add(vertex);

Vertex Removal

Graph<Vertex> graph = Graphs.newEmptyGraph();
Vertex vertex = new Vertex();
graph.add(vertex);
graph.remove(vertex);

Edge Creation

Graph<Vertex> graph = Graphs.newEmptyGraph();
Vertex one = new Vertex(123, 456, 0);
Vertex two = new Vertex(321, 654, 0);
double weight = 14.5;
graph.add(one);
graph.add(two);
Edge<Vertex> edge = graph.connect(one, two, weight);

Edge Removal

Graph<Vertex> graph = Graphs.newEmptyGraph();
Vertex one = new Vertex(123, 456, 0);
Vertex two = new Vertex(321, 654, 0);
double weight = 14.5;
graph.add(one);
graph.add(two);
Edge<Vertex> edge = graph.connect(one, two, weight);
graph.disconnect(one, two); 
// or
graph.disconnect(edge);

Edge Creation (bidirectional)

Graph<Vertex> graph = Graphs.newEmptyGraph();
Vertex one = new Vertex(123, 456, 0);
Vertex two = new Vertex(321, 654, 0);
double weight = 14.5;
graph.add(one);
graph.add(two);
graph.connectBidirectional(one, two, weight);

Edge Removal (bidirectional)

Graph<Vertex> graph = Graphs.newEmptyGraph();
Vertex one = new Vertex(123, 456, 0);
Vertex two = new Vertex(321, 654, 0);
double weight = 14.5;
graph.add(one);
graph.add(two);
graph.connectBidirectional(one, two, weight);
graph.disconnectBidirectional(one, two);

About

Graph traversal and optimization framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages