First BasicDirectedCostFunction implementation