Graph representation & Djikstra algorithm