Modelling and Optimisation with Graphs