Connected Component Comparison - HelenYunes/OOP_Ex3 GitHub Wiki

connected_component()

The first method we'll be comparing and testing is connected_component(id1). This method finds all the Strongly Connected Component(SCC) that some node id1 is a part of.
The test is performed from a Python file and a Java file which runs the method on the same graphs and calculates the runtime of each method on a given graph with the use of the Time library. Here are the results for our code in Python and Java head to head:

connected component comparison

As we can tell our code in Python has performed slightly better than the code in Java. here is the comparison shown in a graph:
graph_java_python

Also we can see that the larger the graph gets the bigger is the difference between the two languages: connected_component_algorithm

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.