Interior Point Method(Path following) vs Simplex [closed] - linear-programming

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What are pros and cons of these two LP methods ?
I can only think of less iterations in Interior Point Method (when LPP is sufficiently large).

I'm going to list some features of both algorithms to explain what differentiates them.
Simplex
provides a basic solution, useful for branch and bound solvers in integer programming
easy to warm (or hot) start from a suboptimal solution, also necessary for integer programming
very high iteration speed mainly due to preservation of sparse data structures, but sometimes requires many iterations to reach optimality
memory efficient
numerically very stable
Interior Point
iteration count independent of problem size
often faster to reach optimality
easier to parallelize (Cholesky factorization)
In summary, IPM is the way to go for pure LPs, while for reoptimization-heavy applications like (mixed) integer programming the Simplex is better suited. One may also combine both approaches and perform a Simplex-like cross-over after the IPM found an optimal solution to get a basic one.
Often, it is a good idea to try both methods and decide then what works best, because performance is very much problem dependent.

Related

How do I compare two functions' speed and performance [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have two functions performing same process but with different techniques and I need to know on a large scale which technique is faster than the other of maybe in the future will be more techniques available. So my question is, how can I do that in c++ specially? Is there a specific method and header to be used to perform this task?
More details:
For example the isLargest() uses three parameters and it has two versions, one uses a nested if technique and the other uses initializers and less if statements. So if I need to know which one is faster, how can I do that?
Try your code in the real world and measure
There is a tool called a profiler that is meant to solve this problem. Broadly speaking, there are two kinds (note: some are a mix between the two):
Sampling profilers.
Instrumenting profilers.
It's worth learning about what each does and their pros/cons, but if you don't know what to use go with a sampling profiler.
There are many sampling profilers, but support depends on your platform. If you're on Windows, Visual Studio comes with a really nice sampling profiler and I recommend you start there!
If you go down this route, it's important to make sure you use your functions as you would "for real" when you're profiling them, as there are many subtle factors that can affect the result.
An alternative
If you don't want to try your code running in a real program, perhaps if you're just trying to understand general characteristics of the function, there are libraries to help you do this such as Google Benchmark.
Benchmarking code can be surprisingly difficult to get right, so I would strongly recommend using existing benchmarking tools where like Google Benchmark wherever possible.

How to Parallelize PDF to HTML conversion on GPU? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I want to Parallelize PDF to HTML conversion. Not in file level, but in page level or object level. Is it a wise choice for parallelization? If it is so, how it can be done? Will the speed be appreciable in GPU, when compared with the same in CPU??
My simplest answer would be - it may be not feasible.
Basically - The most important classification here is whether a problem is task parallel or data parallel. The first one refers, roughly speaking, to problems where several threads are working on their own tasks, more or less independently. The second one refers to problems where many threads are all doing the same - but on different parts of the data.The latter is the kind of problem that GPUs are good at: They have many cores, and all the cores do the same, but operate on different parts of the input data.
Next issue is to move the data around.
GPU programming is an art, and it can be very, very challenging to get it right.
So the question is - can you parallelize the of the format conversion? I did some conversions before and almost none of them were feasible for parallel processing.

Multiplicaton of big integers (factorial) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I accidentally saw on Internet that functional programming language SML allows to do arbitrary precision integer arithmetic. I had written big integer arithmetic on C++ before and I decided(for curiosity) to compare my implementation with SML's by computing factorial of big numbers. I found out that SML program works about 15 times faster than mine. My implementation uses elementary school multiplication algorithm. But as I know the fast algorithms (such as FFT or Karatsuba's algorithm) worked better than elementary school multiplication when multipliers aren't much different. In this case they are, because (n-1)! is much greater than n. My question is what are the other possible reasons that the SML program works so faster.
Three possible reasons:
It uses multiple CPU cores (easy to test)
It uses SIMD instructions
It uses GPU (rare, but not unheard of)

AI for time table generator software [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to develop a time table generator software for my college. Obviously it requires a great deal of constraint satisfaction i.e. I need to satisfy a lot of rules in order to generate a bunch of time tables where classes do not clash. After doing some research and reading this article, I feel I need to use some AI in it. Now, I am a complete newbie to AI. Can anyone tell me which algorithm will work best in my case?
The simplest algorithm that you can use for this problem is genetic algorithm (or any other evolutionary algorithm). Solving this problem using GA is very simple but yet effective. There are lots of papers and codes that have used this approach for this problem.
If you have few rules and constraints, you may want to use exact straightforward techniques like backtracking with CSP heuristics to speed it up, but if there are lots of classes and constraints, I suggest Genetic Algorithm.
Well, not a trivial task indeed. Problems like this one are VERY hard to solve.
Here I can recommend you two things:
Use an existing CSP/COP solver and describe your constraints in its language. These solvers are very good, fast and tuned, being developed for years.
Educate yourself in the area of Discrete Optimization (there was a course at coursera.org with the same name which was great). Only after you grasp the basics of how these things work can you try to write your own solver. But let you be warned! Discrete optimization is pain and suffering :-).
This is by no means a suitable place to just tell you how CSP/COP works. It is a very broad and difficult field.
I wish you good luck!

On what amount of work does using OpenMP start making sense? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I recently started looking on parallelization using OpenMP and found a decent amount of good resources describing how to use it. However, I was unable to find documentation on when parallelization starts making sense or in other words: where is the turning point where parallelization start compensating the overhead of OpenMP's thread creation and in what cases is it better to go without it? How complex has work to be so it makes sense to parallelize it?
Is there any documentation or guide available on that?
From my own experience, if your computation is well suited for parallelization, you can expect substantial gain if the serial computation (for example the loop you want to parallelize) takes a few milliseconds.
Below 1 millisecond, it will not help to use multiple threads due to the overhead involved.
Image processing would be one good example...
I used it when running sift and surf on two consecutive images..
I find it useful if you need to do heavy mathematical calculations especially on matrixes..