Network algo removes odd segments and connects endpoint to existing nodes.

TODO: Add comments to magic numbers
TODO: Add points to junctions for endpoints to connect to