title: Add additional cost to path depending on label of edge
body: <p>I have a graph with some edges. Each edge has a weight/cost and also a label/type, which could be <code>red</code> and <code>green</code>.</p>
  <p>I know that if I run Dijkstra's algorithm it will find the shortest/cheapest path from the weights of all edges. However, my issue is that depending on which type of edge it chooses, additional cost should be added. In principle, the additional cost should only be added each time a new type is used.</p>
  <p>So for example if the path I find from Dijkstra's is:</p>
  <pre><code>node1  ---&gt;  node2  ---&gt;  node3  ---&gt;  node4  -----&gt;  node5  -----&gt;  node6
  
  |---- edge1  --|-- edge2 ---|--- edge3 --|--- edge4 ----|--- edge5 ----|
  
     type = red    type = red   type = red   type = green   type = green
  </code></pre>
  <p>The additional cost added should then be added according to this setup/logic:</p>
  <pre><code>for i, edge in enumerate(path.edges):
      if edge[i].type == edge[i+1].type:
          &lt;do not add any additional cost&gt;
      elif edge[i].type != edge[i+1].type:
          &lt;add additional cost to [i] edge&gt;
  </code></pre>
  <p>So the additional cost should only be added if there is a change between types within the path.</p>
  <p>I have no idea if this is even possible to do in any way ?</p>