Code Monkey home page Code Monkey logo

hcptosat's People

Contributors

abetusk avatar codemunin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

abetusk

hcptosat's Issues

Hamiltonian path

Hi guys,

I actually need to check if a graph has a Hamiltonian pat. How could I do it in your solver?
I would not want to use the reduction from HP to HC since you are already using it in the other direction by solving HP.

Thanks,
Myro

Instance sizes

Hey guys,

your code runs really fast!
What instances have you tried? Say planar graphs on 30, 50, 100 vertices?
What was the largest instance?

Thanks!

Compile error when making `encoders/helga_sequential`

When trying to run make in the encoders/helga_sequential subdirectory, I get the following error:

$ make
Scanning dependencies of target helga
[ 50%] Building CXX object CMakeFiles/helga.dir/helga.cxx.o
In file included from XXX/7hal32/HCPtoSAT/encoders/helga_sequential/helga.cxx:13:0:
XXX/7hal32/HCPtoSAT/encoders/helga_sequential/../shared/SatInterface.cxx: In function ‘std::__cxx11::string execToString(const char*)’:
XXX/7hal32/HCPtoSAT/encoders/helga_sequential/../shared/SatInterface.cxx:11:9: error: ‘shared_ptr’ is not a member of ‘std’
         std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
         ^
XXX/7hal32/HCPtoSAT/encoders/helga_sequential/../shared/SatInterface.cxx:11:29: error: expected primary-expression before ‘>’ token
         std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
                             ^
XXX/7hal32/HCPtoSAT/encoders/helga_sequential/../shared/SatInterface.cxx:11:59: error: ‘pipe’ was not declared in this scope
         std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
                                                           ^
CMakeFiles/helga.dir/build.make:62: recipe for target 'CMakeFiles/helga.dir/helga.cxx.o' failed
make[2]: *** [CMakeFiles/helga.dir/helga.cxx.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helga.dir/all' failed
make[1]: *** [CMakeFiles/helga.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

From looking around, I see shared_ptr is presumably defined in the memory header file. Adding an include to encoders/shared/SatInterface.cxx allows the compilation to go through.

Here is a diff:

$ git diff
diff --git a/encoders/shared/SatInterface.cxx b/encoders/shared/SatInterface.cxx
index 031f2fa..a8a2223 100644
--- a/encoders/shared/SatInterface.cxx
+++ b/encoders/shared/SatInterface.cxx
@@ -1,6 +1,8 @@
 #include <string>
 #include <stdlib.h>
 
+#include <memory>
+
 // run cmd and write it to std::to_string
 // idea by http://stackoverflow.com/questions/478898/how-to-execute-a-command-and-get-output-of-command-within-c-using-posix
 std::string execToString(const char* cmd) {

Happy to submit a PR if that's helpful.

Clauses used

Hello!
I'm currently working in a similar scholar project and I'd like to know what clauses are you using to reduce the hamiltonian path problem to a SAT instance?
Are you using any additional heuristic for optimization?
Thank you

in.txt

Hey, guys
how can I predefine the path to in.txt file? I mean, how do I set the folder where the encoder writes in.txt and where the solver can find it. So far it seems to be automatically chosen, which is inconvenient since I want to run many parallel experiments.

Thanks!

Undirected graphs

Tried this input graph, which is just K_4
p edge 4 6
e 1 2
e 1 3
e 1 4
e 2 3
e 2 4
e 3 4
And the solver says UNSATISFIABLE :(

Cannot run

I am running the command:

./helga.out ../../graphs/hc-4.col "../../solvers/lingeling/plingeling in.txt"
And then I get some output:

parsing graph from file into adjacency matrix
constraint (3) FINISHED (from 1 to -2)
constraint (1) finished
constraint (2) finished
constraint (4) finished
constraint (5) finished
constraint (6) finished
INFO - writing results to file
INFO - starting solver with provided command
SUCCESS - solver finished and returned result
s SATISFIABLE

but no path itself.
Am I doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.