In general eco-routing computes an optimal route for an “eco cost model” using the same underlying optimal algorithm like for fastest or shortest routes. The only difference is the “cost model” used for the computation, i.e. the way how “costs” are calculated for a road.
The eco cost model itself is a little bit harder to explain than the one for fastest or shortest, where the costs are mainly travel time or distance per road. The eco model uses a combination of consumption and travel time:
- The consumption part is determined via the physical consumption model that can be specified in the API. With this consumption model and road attributes form the map and online services (like historic/traffic speed, slopes, speed variations due to curvature, stop probabilites at crossings, …) the consumption of a road (and route) can be determined quite precisely. Btw, for electric vehicles also recuperation effects are taken into account by the consumption model.
- Optimizing for consumption only often leads to strange/unwanted detours that save a few milliliters/Wh but take much longer. Therefore, also the travel time is taken into account in the eco cost model.
In the end, you get a good compromise of a route that has little consumption while not taking much longer than the fastest route.