small docstring improvement
new functionnality: possibility to (reverse) sort

adding the functionnality in the lib (flag sort in graph())
plus the associated unit tests