How should I go about testing first solution strategies? - or-tools

I am trying to solve a large vehicle routing problem with many pickup and delivery constraints and time windows and demands. There are so many first search strategies and I am a novice user that does not know which one to try first and how to set it up. Is there a brute force solve method that tries one solver after the other? Which first solution strategies should I definitely try?

The way I did it was one by one and checked the answers, there are not that many first solution strategy. "PathCheapestArc works the best based on my experience.

Related

How to control events scheduling in Anylogic?

Is there a way to manually schedule the events in AnyLogic? or does the order of creating the model plays a role in that?.
I am creating a complex system which currently not behaving in the same order I am expecting. I looked at AnyLogic help and Stuart Rossiter explanation but, I was not able to draw answers for these two questions.
My approach to the problem is to use FIFO in the experiment with a statechart that is knotted with guards for each state (true if related are all complete ). And I was thinking to use a manually programmed time parameter for the whole model to order the events exactly as I want. I am not sure that this is the right approach or if I will work. Please guide me on that matter.
Thanks InAdvance;
These are my answers:
Yes, there is a way to control the events manually (synchronizing).
Its done by creating several events and ordering their
trigger/re-occurrence times similar to the simulated phenomena.
No, of you are using manual synchronizing, and I don't know about Asynchronous modeling
the approach mentioned in the question did not work :).

How can I increase the recurrence of a question in a quiz?

I am developing a quiz based app on Swift and the questions repeat several times within a set time limit. If the user gets a specific question wrong I would like the app to increase the recurrence of this question.
Any help would be appreciated greatly!
Many thanks,
Jonny
Not really a Swift question - more about what approach to take to solve your problem. There are many ways to achieve this and which one is right for you will probably depend upon how precise you want to be with the probabilities of a particular question being asked and your own coding ability.
The simplest approach would probably be to have an array of questions and use array.randomElement() to choose a question randomly from that array. If the user gets the question wrong you add that question to the array again. That's definitely not the best approach but if you are having trouble with this yourself it may be the best for you.

Graphstream MultiGraph to SingleGraph at runtime (and vice-versa)

I've only started using Graphstream a couple of weeks ago, and so far it is working pretty well, but I have one issue that I have not been able to solve:
I am displaying data which for smaller datasets is nice to view as a MultiGraph, and for larger datasets becomes to hectic and would be nicer to view as a SingleGraph. What I'm trying to accomplish is at runtime to either dump the data from a SingleGraph into a MultiGraph (and vice versa) on some user action. Either that or use MultiGraph all the time if there is some way to suggest to it to display only a single edge between nodes?
So far my only semi-reasonable-looking-to-implement-solution that I have thought up was maintaining both a SingleGraph and MultiGraph and swapping them out with the viewer when the user performs the swap action, but that seemed kludgy (and would have to do every operation on both graphs). I searched around the docs and web for quite awhile but have not come up with a reasonable solution so far...so if anyone knows of an easier way, please let me know :)
EDIT: Solution found (good enough for us anyway)
So what I ended up doing is adding another ui.class to the edges that are known to be duplicates at graph construction time, which for now I made a much less obvious color, so they fade into the background when you're trying to look at the singlegraph links. I could also use this to iterate over the graph and hide them (or just redefine the css to be the same as the background color...or something)...It's not quite what I wanted, but looks like it will serve us well enough for the near and medium term on this project.
Thanks,
-Dave

How do you evaluate a framework, library, or tool before adding it to your project?

There's so many cool ideas out there (ninject, automapper, specflow, etc) that look like they would help but I don't want to add something, tell others about it, and try using it just for it to be added to the growing heap of ideas that didn't quite work out. How can I determine if the promised benefits will happen and that it won't end up as something to be ignored or worked around?
Have a problem
Identify the cost of having the problem, or the value to solving it
Prioritize it against other problems
When it's the top priority, look for a solution that solves the problem with a proportional cost
Do you have the problem that ninject solves? Is it an important problem to solve? Is it the most important? What value will you get from solving it?
I don't think that you can tell whether any framework will deliver your expectations until you try it, and try it in anger and in context. This is usually time consuming and inevitably you'll have a few misses before you get any hits. Don't commit yourself by working through a simple sample from the authors website or howto files; these will always work and may impress but until you try to use the framework in the context of your billion user, multi-lingual, real-time on- and off- line application you're not going to find it's shortcomings.

Exhaustive website verifier

I have this grand idea to basically employ some brute force attack to test/verify that my web application doesn't crash.
Don't get me started on unit testing, and IoC stuff, this is something else entirely.
What I'm doing, and what I'm asking for help with is to create an intelligent exhaustive search, that explore parts of the program state.
What I have is a web page with things I can do, clicking is one thing, text input is another, some inputs like radio buttons and drop down lists are constrained to certain values. Pretty basic things. What I end up with a finite set of events and values and what I want to model is a progression of state. Maybe this is FSM optimization in a way, but the goal is to systematically go through arbitrary permutations of events and values and see what happens.
When a problem is found I want to try and provoke that error with as little effort as possible to be able to present a clear test case.
This relates to formal verification methods and I'm asking for help or insight from people with experience.
What you want to do sounds a little like model-checking, on the one hand, and automated test case generation on the other hand (in the latter category check out Concolic testing, a technique to avoid wasting time with unfeasible execution paths).
Model-checking would be the preferred method if you assume your web application is correct and want to prove that it is. But in the case of a warning, you may have to work to understand if the problem is real or not. Test case generation is oriented towards bug-finding: it does not prove that you app is correct, but if it finds a problem, it gives you an input vector to produce it so you don't need to wonder if the problem is real.
I am not aware of any existing tools for web apps, but that doesn't mean that they don't exist.
It sounds like you want a fuzzer. Peach is one such tool.
Exhaustive search can be non trivial task for limited resource (memory,space) ,but with many techniques the problem can be reduced ,like abstracting you code (ex: replacing database driver classes with stubs), an experience is presented in this paper: Abstract Model Checking of Web Applications Using Java PathFinder (Vinh Cuong Tran, Yoshinori Tanabe, Masami Hagiya, University of Tokyo).
If you look to a kind of formal verification of FSM like models, Java PathFinder has an extension to verify UML state charts written in Java+annotation (it depends on the Javapathfinder VM):
http://babelfish.arc.nasa.gov/trac/jpf/wiki/projects/jpf-statechart