Connected Component(s) Comparison - HelenYunes/OOP_Ex3 GitHub Wiki

connected_components()

The second method we'll be comparing and testing is connected_components(). This method finds all the Strongly Connected Component(SCC) in a graph. The test is performed from a Python file and a Java file which runs the method on the same graph and calculates the runtime of each method on a given graphs with the use of the Time library. Then also compared with the Networkx's method. Here are the results for our code in Python and Networkx's head to head:

ours_networkx

As we can tell our method and Network'x method has similar runtime while the Java method has slightly longer runtime which is shown in the graph: connected_componnents_graph

We can also tell that as we test larger graphs the difference starts to grow which is shown in the diagram: connected_componnent_diagram

In conclusion we can say that the Python method outperforms the Java method. While the difference is quite negligible on the smaller graphs, as they get larger the difference starts to really show. Networkx method has very similar runtime to our python, the difference is very negligible although our method outperforms on the largest graph we tested very so slightly.