graphdb/src/main/java/com/orientechnologies/orient/graph/sql/functions/OSQLFunctionHeuristicPathFinderAbstract.java
protected double getTieBreakingHeuristicCost(double x, double y, double sx, double sy, double gx, double gy, double heuristic) {
        double dx1 = x - gx;
        double dy1 = y - gy;
        double dx2 = sx - gx;
        double dy2 = sy - gy;
        double cross = Math.abs(dx1 * dy2 - dx2 * dy1);
        heuristic += (cross * 0.0001);
        return heuristic;
    }
protected double getTieBreakingHeuristicCost(double x, double y, double sx, double sy, double gx, double gy, double heuristic) {
        double dx1 = x - gx;
        double dy1 = y - gy;
        double dx2 = sx - gx;
        double dy2 = sy - gy;
        double cross = Math.abs(dx1 * dy2 - dx2 * dy1);
        heuristic += (cross * 0.0001);
        return heuristic;
    }
obtains from http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html