package routing

import (
	

	
	
)

func estimateRouteCostGuarded( layoutgraph.Edges,  *layoutgraph.Edge,  workBudget) (float64, error) {
	 := 0.0
	for  := 0;  < len(.Points)-1; ++ {
		if  := .step();  != nil {
			return 0, 
		}
		 += geo.EuclideanDistance(
			.Points[].X,
			.Points[].Y,
			.Points[+1].X,
			.Points[+1].Y,
		)
	}
	 :=  * math.Pow(turnPenalty, float64(len(.Points)-2))

	var  int64
	for ,  := range  {
		if  := .step();  != nil {
			return 0, 
		}
		if  ==  {
			continue
		}
		for  := 0;  < len(.Points)-1; ++ {
			for  := 0;  < len(.Points)-1; ++ {
				if  := .step();  != nil {
					return 0, 
				}
				if isNonSharedCrossing(, , , ) {
					++
				}
			}
		}
	}
	 += layoutgraph.CrossingCostWeight * float64()
	return , nil
}

func routeIntersectsNodeGuarded( layoutgraph.Nodes,  *layoutgraph.Edge,  workBudget) (bool, error) {
	for ,  := range  {
		if  := .step();  != nil {
			return false, 
		}
		if .From.IsDescendantOf() || .To.IsDescendantOf() {
			continue
		}
		for  := 0;  < len(.Points)-1; ++ {
			if  := .step();  != nil {
				return false, 
			}
			if .PassesThrough(.Points[], .Points[+1]) {
				return true, nil
			}
		}
	}
	return false, nil
}