Path with bandwidth constraint in a weigthed graph - algorithm

Suppose I have a network of interconnected switches. Every link connecting two different switches has its own positive usage cost and maximum bandwidth that it can pass through. Is there an algorithm / a combination of algorithms to optimally find paths between specified ports of different switches where every such path has minimal possible cost and guarantees to be able to pass through traffic of a predefined bandwidth?
Using Dijkstra's algorithm on a weighted graph solves the problem of finding minimal cost path, but what to do with bandwidth requirement? If such algorithm exists will it give optimal solution when requests to find a path aren't known all beforehand, but come one after another?
Thank you!

Merely determining the feasibility of routing several demands as paths is strongly NP-hard, by reduction from, e.g., the 3-partition problem. The tough constraint is routing a whole demand on just one path. If we allow multiple paths (i.e., a flow), then we get the minimum-cost multi-commodity flow problem, which is polynomial-time solvable (albeit inefficiently in practice). It seems unlikely that there is an optimal online algorithm for either problem.

Related

Why is ford-fulkerson so ubiquitous?

When looking at max flow solutions, ford-fulkerson seems to be ubiquitous in that it is the algorithm most people implement to solve this problem. However there are many more algorithms that can solve the problems and at a significantly better time complexity. So why is ford-fulkerson still so widely used then?
Ford–Fulkerson is the simplest algorithm that embodies the key idea that a flow is maximum if and only if it has no augmenting path. This makes it useful for teaching.
Since F–F doesn't specify how to find an augmenting path, it's more of a framework than an algorithm. Edmonds–Karp is an instantiation of F–F that bounds the number of augmenting paths that must be found. Dinic's algorithm improves on Edmonds–Karp by keeping a data structure that allows it to find augmenting paths more efficiently. (Off the beaten path a bit, the O(n log n)-time algorithm for s-t flow in planar networks due to Borradaile and Klein is also an F–F instantiation.)
The push-relabel algorithms take the idea behind Dinic's algorithm one step further, but they break out of the F–F mold in using preflows, not flows (preflows allow more flow to enter a vertex than leaves, but not vice versa). Historically they followed Dinic's algorithm and make more intuitive sense as a reaction to Dinic.
The other algorithms on that list are complicated and not suitable for undergraduate instruction, which explains the lack of tutorial material.
Ford-Fulkerson algorithm gives the fundamental paradigm to solve a maximum flow problem. Suppose a graph, consisting of Vs and Es, has a source and sink defined. Along with this there is a capacity defined for each E. The ford fulkerson algorithm directs us to find an augmenting path (a path whose capacity has not reached its limit), and to send as much flow as we can through that path, and accordingly update the capacities.
Ford-Fulkerson algorithm however, doesn't exactly specify how to find these augmenting paths. This is the primary research that is done today in this field. The classic ford fulkerson with simple graph searching algorithms give the time complexity of O(n^2). There have been several attempts from Dinitz, to many other CS experts such as Spielman and Teng, who have managed to bring the complexity down to a level of O(n^1.43). The primary challenge these days is to bring the time to nearly linear.

Algorithms: Esau-Williams algorithm

I would like to ask are there any sittuations that Esau-Williams algorithm may be useful? I know that it is used to solve CMST problem, but I can't find any sittuation that CMST problem may appear.
According to Wikipedia, "CMST problem is important in network design: when many terminal computers have to be connected to the central hub, the star configuration is usually not the minimum cost design. Finding a CMST that organizes the terminals into subnetworks can lower the cost of implementing a network."
As the name suggests, CMST stands for Capacitated Minimum Spanning Tree where each nodes have limited capacity to connect to other nodes. This makes a node to connect to limited number of other nodes depending on the node's capacity.
Typically in any practical applications, a minimum spanning tree is not the only objective. There can be a lot of other constraints as well, for instance, in a network design the maximum amount of data that the output port of router(node) can handle is one capacity constraint. This marks the importance on heuristic algorithms like Esau-Williams CMST algorithm, Modified Kruskal CMST Algorithm etc..
Like networking any field which uses graphs, for example logistics, based on their constraints can use heuristic algorithms like Esau-William
CMST can be utilised in cases such as deciding the cable layout for offshore wind turbines where each turbine has to be connected to a point in euclidean space called sub station. We cant use minimum spanning tree because it has capacity limitation on the number of turbines that can be connected on a single cable.

Graph search algorithm where edges can be blocked by obstacles

I want to find a low-cost path between two vertices on a directed graph where the cost of each edge is the same. Ease of implementing the algorithm and performance time are very important, so I am willing to sacrifice an optimal solution for one that is near-optimal, if the algorithm is simpler and quicker.
An edge can be blocked by an obstacle. The probability that an edge is blocked is known beforehand. Blockages are independent of each other. An edge is found to be unblocked or blocked when the vertex at the head of the edge is reached.
My problem is similar to the Canadian Traveller Problem, but my understanding is that solutions for stochastic programming problems are relatively difficult to implement, and the time taken to find an optimal policy can be relatively high.
At the moment, I am thinking of converting the problem into a deterministic one so that it can be solved using a search algorithm like A*. Is this a good approach, and if so, how can I do this?
This problem is a partially observable Markov decision process (POMDP). POMDPs can be solved deterministically, but usually use a randomized algorithm to find an approximately-optimal solution. Finding the true optimum policy does not have a polynomial time solution, and even approximate solutions can be slow. On the upside, once you've found the policy, following it is fast.
Some of the available solvers:
ZMDP
Symbolic Perseus
APPL
pomdp-solve
SPUDD

How to find shortest path in dynamic situation

Some days ago, Someone ask me, If we have some agents in our environment, and they want go from their sources to their destinations, how we can find the total shortest path for all of them such that they shouldn't have conflict during their walk.
The point of problem is all agents simultaneously walking in environment (which can be modeled by undirected weighted graph), and we shouldn't have any collision. I thought about this but I couldn't find optimum path for all of them. But sure there are too many heuristic ideas for this problem.
Assume input is graph G(V,E), m agents which are in: S1, S2,...,Sm nodes of graph in startup and they should go to nodes D1,...Dm at the end. Also may be there is conflict in nodes Si or Di,... but these conflicts are not important they shouldn't have conflict when they are in their internal nodes of their path.
If their path shouldn't have same internal node, It will be kind of k-disjoint paths problem which is NPC, but in this case paths can have same nodes, but agent shouldn't be in same node in same time. I don't know I can tell the exact problem statement or not. If is confusing tell me in comments to edit it.
Is there any optimal and fast algorithm (by optimal I mean sum of length of all paths be as smallest as possible, and by fast I mean good polynomial time algorithm).
A Google search reveals two links that might be helpful:
Cooperative path planning for multi-robot systems in dynamic domains
Optimizing schedules for prioritized path planning of multi-robot systems
Edit: From the book chapter (first link):
There are various approaches to path planning in multi-robot system [sic], however, finding the
optimal solution is NP-hard. Hopcraft et al. (1984) simplify the planning problem to the
problem of moving rectangles in a rectangular container. They proved the NP-hardness of
finding a plan from a given configuration to a goal configuration with the least amount of
steps. Hence, all feasible approaches to path planning are a compromise between efficiency
and accuracy of the result.
I can't find the original paper by Hopcroft online, but given that quote, I suspect the problem they reduced the navigation task to is similar to Rush Hour, which is PSPACE-complete.
If it's just a matter of getting from point a to point b for each robot, you could just use a search algorithm like A* (A Star) or Best-First.
Give it a simple heuristic like the sum of distances from goal.

Longest circle in graphs

I want to solve the following problem:
I have a DAG which contains cities and jobs between them that needs to be done. The jobs are for trucks which can load a definied limit. The more the truck is loaded the better is the tour. Some jobs are for loading something in and some are for loading defined things out. You can always drive from city a to b even if there is no job to be done between them.
The last restriction is that I always need to start in city a and return to a because there is the home of the trucks :)
I first thought of Dijkstra's shortest path algorithm. I could easly turn that into longest path calculation. My problem in mind is now that all these algorithms are for calculating a shortest or longest path from vertex a to b, but I need it from a returning to a - in a circle.
Has some one some kicks for my mind?
Thanks for your feedback!
Marco
This crazy combination of knapsack and travelling salesman is surely NP-hard.
Virtually everywhere, when you want to load your agent with optimal job schedule, or when you want to build a route through all vertexes in the graph, or when you feel that you need to look for a "longest path*", you most likely run into an NP-complete or an NP-hard problem.
That means, that there is no known fast and exact solution to the problem, i.e. the one that runs in a polynomial time.
So you have to create approximations and implement non-optimal algorithms based on your particular conditions. What time loss is acceptable? Are there additional patterns the trucks can drive? Do you know more about the graph (e.g. is the area divided into distant dense regions)? Answer these questions and you'll find a non-strict heuristics that satisfies your customers.
*yes, searching for longest paths is not as easy as you think. Longest path problem is NP-complete, given that your graph is not acyclic.
You're trying to find the smallest possible way to get everything done? This reminds me of a max-flow/min-cut problem. You might be able to approximate the best answer by:
Connect all terminal nodes to a final end node.
Run one of the various maximum flow algorithms to find the max flow between a and end.
Return to city a. Update the graph to reflect what you just did. Repeat until all jobs are done.
The idea is that you get the most bang for every trip. Each trip after the 1st will be less efficient and less efficient, but that's to be expected.
Note: This only works because you have a DAG. Travelling salesman wouldn't be NP-Complete on a DAG, either, and it will likely be impossible to even hit all nodes on the graph. Re-reading your problem, it seems like you don't have a DAG, since you can return to city a - is that true?
You can adjust the traveling sales man problem dynamic programming algorithm to do what you want.
The classic approach says that you want to maximize the optimum function from all cities but you can take in consideration, at each step also the possibility of returning home.
And like Pavel mentioned, this problem is definitively NP-hard. Do you have some upper bounds for the number of cities or maximum number of objects that can be loaded in a truck?
PS: Do you want the BEST solution (maximum profit - might not be realistic in terms of processing time) or you accept some approximation?
Isn't this a Transportation problem?
Depending on the trucks number and starting points, you could add a fake transporations or add costs in order to satisfy your restrictions.
I'd also ask about truck restrictions:
are they all based in the same city?
do you have a fixed number of them?
and what you win if you use less then
you have?
is there a cycle time restriction?

Resources