This change will break existing clients of the library. Imagine someone used this function like this:

``` js
operations.density(graph);
```

They didn't pass the second argument and they expected this function to return a density of undirected graph. Now with this change this function will return density of directed graph instead, thus will break client's expectations.

Instead of passing `undirected` argument, change it to `directed`. This way new clients can opt in to use directed version, and old clients will remain intact.