function connect_edges() added to semi-markov model