示例#1
0
        public int GetAllRoutesMaxDistance(char startNode, char endNode, int maxDistance)
        {
            GraphInstance graph = GraphInstance.Instance;

            if (!graph.IsGraphBuilded())
            {
                BuildGraphInstance();
            }

            return(graph.AllRoutesMaxDistance(startNode, endNode, maxDistance));
        }
示例#2
0
        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);
        }