When working with graphs and particularly with networks, it is very useful to generate them automatically.
The function gen_net can be used in Metanet to generate networks. It uses a triangulation method for generating a planar connected graph and then uses the information of the user to give arcs and nodes good values of costs and capacities.