Skip to content

Graph data structure for quickly detecting if two vertices have a path between them

Notifications You must be signed in to change notification settings

xaellison/FastConnectivityGraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

FastConnectivityGraphs

Written for a tech interview in 2016. A graph data structure which allows for constant time checks if two vertices have a path connecting them (equivalently, that they're in the same component).

Running

Currently the main method awaits standard input. For testing performance, you can un-comment out randomizedTest(); in main.

Compile: javac FastConnectivityGraphs.java

Run:

alex$ java FastConnectivityGraph
add 1
add 2
is linked 1 2
false
add 1 2
is linked 1 2
true
add 3 4
is linked 3 4
true
is linked 2 3
false

About

Graph data structure for quickly detecting if two vertices have a path between them

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages