Geometry And Topology Of Optimal Flow Networks