paminco
differentiate edge costs.
See also
paminco.net.cost.PolynomialCost.differentiate
paminco.net.cost.PiecewiseQuadraticCost.differentiate