problem: visiting as many places as possible within the given time and come back to starting point.
I searched the internet and could not find any tutorial or implementation of any algorithm for that problem. Mostly research papers came out.
So, hoping people point out useful sources, then I could pick one and solve my problem.
thanks.
I find out that "Clarke-Wright algorithm" solves VRP and TSP is a special case of VRP.
Maybe that is what I need.
anyone correct me if I am wrong.
Related
I'm currently trying to build a music generator. In order to improve my deal with patterns in music, I have read this article, which states that "This algorithm (exon-chaining algorithm) can be modified to accommodate the pattern selection problem by replacing the weight of an interval with its duration".(page 9).
However, I'm having trouble understanding the meaning of the exon-chaining problem. I have looked for this problem in many different presentations and articles but still couldn't find satisfying information. I would really appreciate it if someone could explain it to me.
Thanks in advance.
I am developing an Application which will allocate Cabs to the Employees.The pickup location will be office location for everyone and Drop Location can be any location in the City.Which algorithm like BFS, DFS can i use which will give me the optimized path which will help me to optimize the cost Expenditure.
Any Suggestion is Welcome and highly appreciated
Problem, as stated, is too short of details to be given a specific answer. Some general pointers follow that may be helpful.
There is a class of problems within Vehicle Routing Problem literature that deals with pickup and delivery problems.
Within these problems, there are problems further classified based on whether or not there exist time windows for pickup and/or delivery.
None of the simple algorithms you have in mind BFS/DFS can give you an optimized solution since the Vehicle Routing Problem is rather difficult to solve practically. It is NP-Hard. The Travelling Salesman Problem is a special case of the Vehicle Routing Problem.
I want to try my hand at finding heuristics/approximations for solving the Traveling Salesman Problem, and in order to do that, I'm looking for some "hard" TSP instances (along with their best known solutions) so that I can try solving them and see how well I can do.
Ideally, they would be simply a text-based list of adjacency matrices or adjacency lists (I don't want to deal with parsing, just the algorithm).
By "hard", I mean that they should be practically impossible to solve or approximate using brute-force.
(This is so that I can be reasonably confident that if I find an answer close to the best known answer, then I'm actually doing something right, and not just getting lucky.)
Are there any lists that would work for this purpose? I searched around a bit but didn't find anything.
Here is another question on SE partially answering your problem (it lists problems, but most of these seems not to have a solution provided, but you better check the links anyway - things may have changed).
If you can't find them, what about randomly generating a set of nodes along with a path connecting them, saving the path length as "minimal" (making sure that the longest connection between two nodes is never > X) and then adding a bunch of other paths making sure these are all > X?
This way (unless I am missing something) you have a set of connected nodes "as complex as you want" and know the actual shortest connecting path from the start...
Addendum - if you really want to see how you compare to existing tools, then you have to run these on your generated problems. One that is free and accessible (but I don't know how "efficient" it may be) is the TSP Library for R.
Wikipedia has a list of other free sw packages for this.
Maybe you could create a different SE question asking for how to get other TSP tools.
The TSP gatech site seems to be the canonical site for TSP information.
Here's a list of the available datasets: http://www.tsp.gatech.edu/data/index.html
The optimal solution is available for some datasets with over 10 000 cities. And there are datasets available of over 1 000 000 cities.
There is a well-known algorithm for finding the optimum TSP solution - it is called brute force.
So the only real way you can compare two algorithms has to be on the quality of the solution as well as some other criteria - usually running time.
Even here you run into a problem. Many algorithms are effectively search algorithms, and the longer you search the more possible solutions are evaluated. The algorithms already trade off quality and running time. They may or may not result in the correct (best) answer for some or all graphs.
The only real way you are going to be able to compare your algorithm to others is by implementing the other algorithms then throwing yours and them the same hard problems (and as others have identified, it is easy to make at least some types of hard problems). Implementing these existing algorithms may suggest ways of improving yours. http://en.wikipedia.org/wiki/Travelling_salesman_problem has plenty of algorithms, and at least a couple look very easy to code. Why not implement them as the first benchmark for your algorithm?
I need an algorithm to solve a problem with the following conditions:
There is a set of "n" people and another set of "m" workshops, there are more people than workshops. Each person has chosen a subset of size "j" of the total workshops and has assigned values to each depending on how much they would like to assist that particular workshop. Now, every workshop only has a limited amount of vacancies.
Given these conditions the problem would be:
What is the best way to assign people to workshops, so that each person participates in the workshop which she considers most valuable (given the problem constraints, that is, if a person canĀ“t participate in their first choice, then the algorithm should choose the second, third, fourth, and so on).
I think the problem is related to combinatorial optimization but I don't know much about algorithms. If anyone can tell me the name of one from which to start investigating, I'd be very grateful.
Thanks! And please excuse my english.
This is a matching problem with one-sided preferences (in the sense that people have preferences for the workshops, but not the other way around).
Here is an excellent paper that discusses this problem in more detail: https://mattmccutchen.net/lumc/index.html
An optimal solution to this problem isn't particularly clear. There are many different optimal (Pareto efficient) criterions. Unfortunately, the problem is NP-hard for many of them.
However, there are criterion with polynomial time algorithms. There is a nice list of these in the "Related work" section of the paper I linked.
I just read about the breadth-first search algorithm in the Introduction to Algorithms book and I hand simulated the algorithm on paper. What I would like to do now is to implement it in code for extra practice.
I was thinking about implementing all the data structures from scratch (the adjacency list, the "color", "distance", and "parent" arrays) but then I remembered that there are currently graph libraries out there like the Boost graph library and some other graph APIs in Python.
I also tried looking for some BFS-related problems on UVA and Sphere Judge Online but I can't tell which problems would require a BFS solution.
My question is what would be the most painless way to practice these graph algorithms (not just limited to BFS, but will also come in useful when I want to implement DFS, Dijkstra, Floyd-Warshall, etc). Sites with practice problems are welcomed.
I personally think that the best way to understand those would be implementing the graph representation yourself from scratch.
On the one hand, that would show you actual implementation caveats from which you learn why or why not a particular algorithm might be interesting / good / efficient / whatever. On the other hand, I think that understanding graphs and their real life use, including its implications (recursion, performance/scalability, applications, alternatives, ...), is made easier through the bottom-up approach.
But maybe that's just me. The above is very personal taste.
I found your question interesting, I googled a bit and I found JGraphEd.
It does not cover all graph algorithms but it looks like a good tool for experimentation.
I agree with balpha. The best way to really learn and understand algorithms is to do the implementation. Just pick an algorithm and implement it. When you reach a point where you get stuck or are unsure, look at a number of existing examples. You will then be able to compare your own thinking with that of others from a position of understanding instead of simply accepting what is offered.
Once you have learned what you want to, the best way to solidify your understanding is to try teach it to or describe it to somebody else. You might have some people willing to listen to you, or at the very least you could write a blog entry for people new to the algorithm you have just studied.
But if you are looking for "painless", then maybe you should stay clear of algorithms altogether ;-)
This site could help you
Here you have description of every problem on acm problemset. You can see category of each problem, and hint to solve it. Just browse for graph related problems. Good advice is to use those hints only if you tried to solve problem yourself and failed.
Visualization of some shortest path algorithms on real data, where the explored area is displayed in yellow:
(bidirectional) Dijkstra
A*