How to solve 3SAT using brute force and N.D.M - algorithm

I have been studying and trying to solve 3SAT using brute force and N.D.M but could not do so. can anyone please explain these to me in detail and tell me basic algorithm to solve 3SAT using brute force and N.D.M ? thanks

One Brute Force solution is simply to try all possible inputs. So to try and solve (A|B)&(~A|C)&(~B)&(~C) try 000,001,010,011,100,101,110,111 where xyz is A=x,B=y,C=z.
If by NDM you mean Non-Deterministic Machine as in https://en.wikipedia.org/wiki/Non-deterministic_Turing_machine there are different ways of thinking about this. One is to suppose that you have to pay for computing time, but there is a loophole in the contract, where if you try all possible inputs you only get charged for the longest run of these tries - all the others are free.

Related

Parallel models in Gurobi

I am working in a benders decomposition for a MILP using Gurobi. I usually use LazyCuts to add new constrains to the Master Problem. However, this decomposition gives me the opportunity to solve for each index independently and I try to parallelize the process to give better computational times.
I tried to use multiscenarios approach from Gurobi for my problem, but I havent been able to get it to work properly.
Do you have any suggestion of how to solve in parallel the same problem for different indices?
Thank you in advance for any help.
Ricardo

Fair Attraction Algorithm

Fair Attraction Problem
What I've Tried
I tried thinking about the switches as bits of a bit string. Basically, no matter the state, I need to get them all to zero. And since this question is in a chapter about decrease-and-conquer I tried to solve for n=1. But, I can't even come up with a brute force solution to ensure that one switch is off.
If you have any ideas or hints, please help, thank you.
Since the only feedback we get is when we're in the goal state, the problem is to explore all possible states as efficiently as possible. The relevant mathematical object is called a Gray code. Since you're looking for a recursive construction, the algorithm is:
If there are no switches, then there's one state, and we're in it.
Otherwise, pick a switch. Recursively explore all configurations of the other switches. Flip the held-out switch and then recursively explore the others again.

Generalized assignment

I have a problem like this: there are Y people that need to be
assigned to no more than X sessions at different times according to
their availability, ensuring that no session contains more or less than a
given amount of people (Y/X +/- 20% for example).
The specific problem in which the number of people and the number of
sessions are the same seems to be the same as an assigmnent problem.
However, does anyone have an idea on how to solve this more genral
case?
I'm ok with both pseudo-algorithms or with suggestions on how to use
the GLPK. I could code this in perl or javascript.
I think you are referring to Generalized assignment problem. which fits into your case. The generalized assignment problem is NP-hard

lpsolve feedback during solve

I am using lpsolver inside RStudio to solve a supply chain network optimization problem. The MILP model I am trying to solve is taking a lot of time. I want to know if it is possible to get some feedback from the model when it is solving. Feedback like current objective, current upper bound, etc should be sufficient for me.

Flow Free Like Random Level Generation with only one possible solution?

I've implemented the algorithms marked as the correct answer in this question: What to use for flow free-like game random level creation?
However, using that method will create boards that may have multiple solutions. I was wondering if there is any simple restrictions or modification that can be made to the algorithm to make sure that there is only one possible solution?
Creating unique Numberlink/Flow Free is very difficult. If you look at my algorithm proposal in the mentioned thread, you'll find an algorithm that lets you create puzzles with the necessary condition that solutions must not have a 2x2 square of the same color. The discussion at http://forum.ukpuzzles.org/viewtopic.php?f=3&t=41, however, shows that this is insufficient, since there are also many non-trivial non-unique puzzles.
From my looking into this problem, it seems the only way to solve this problem is to have a separate algorithm for testing uniqueness, and discarding bad instances. One solver that's made precisely for uniqueness testing algorithm is Imo's solver.
Another option is to use multiple different solvers and check that they come up with the same solution.
I think you should implement the solver, which finds all the solutions for some level. The simplest way is backtracking.
When you have many levels, take one by one and look for solutions. As soon as you find the second solution for some level, throw that level away.

Resources