Templating the network class

Templating the network class to be possible to use any
type of vertex