Those tests are a bit difficult to read, so perhaps it makes sense to break them down into simpler independent test cases (see above comment)?

Instead, we could perhaps create individual test cases and construct an $graphExpected in each method, call `$algorithm->createGraph()` and compare by using `assertGraphEquals()`?