Finding the optimum densest subgraph can be computed in polynomial time. However, large graphs require faster running time complexity. This is an implementation of an algorithm that computes an approximation of the densest subgraph in linear time of the input.
A 2-approximation greedy algorithm was implemented in Python and C++
Network datasets: https://snap.stanford.edu/data/egonets-Facebook.html
Results here