Colour of edges according to edge value

I am currently modelling traffic and my map of roads consists of nodes connected with lines. For each road there is maximum capacity and amount of traffic and each road therefore has a utility value between 0 and 1.

To my question; I am wondering whether there is a colouring method for my lines in tikz that defines the colour by a value. For example I may want a high utility value to be red and a low utility level to be green and values in between are gradients of the booth. Is this possible in some way?

EDIT: The answer in the link is useful. I am now updating all my values to my lines manually; is there perhaps a way to retrieve them from a vector?

-
Did you read How to map value to color using TikZ? –  Paul Gaborit May 8 '14 at 13:03
Yes thank you that solved it. Although I am now updating all my values to my lines manually; is there perhaps a way to retrieve them from a vector? –  Seb May 11 '14 at 9:05
You may ask a new question or complete this one. –  Paul Gaborit May 12 '14 at 21:18
Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Paul Gaborit May 13 '14 at 16:24
@Seb any chance for an MWE? –  Paul Gessler Jan 12 at 22:37