public int GetAllRoutesMaxDistance(char startNode, char endNode, int maxDistance) { GraphInstance graph = GraphInstance.Instance; if (!graph.IsGraphBuilded()) { BuildGraphInstance(); } return(graph.AllRoutesMaxDistance(startNode, endNode, maxDistance)); }
public int NumberOfDifferentRoutes(string inputRoutes, string route, int maxDistance) { GraphInstance graph = GraphInstance.Instance; if (!graph.IsGraphBuilded()) { BuildGraphInstance(inputRoutes); } var nodes = route.ToCharArray(); var graphResult = graph.AllRoutesMaxDistance(nodes[0], nodes[1], maxDistance); return(graphResult); }