public static FindingDirectionsProblem BuildMapProblem( IWeightedGraph<FindingDirectionsState, double> graph, // TODO: swap this out for something that isn't a dependency INearestNeighbor<FindingDirectionsState> nodeLocator, double latFrom, double lonFrom, double latTo, double lonTo ) { var from = nodeLocator.FindNearestNeighbor(new FindingDirectionsState(0, null, latFrom, lonFrom)); var to = nodeLocator.FindNearestNeighbor(new FindingDirectionsState(0, null, latTo, lonTo)); var problem = new FindingDirectionsProblem(graph, from, to); return problem; }