Added the graph construction to boruvka algorithm