GithubHelp home page GithubHelp logo

Reproducing Paper Results about graphillion HOT 4 OPEN

takemaru avatar takemaru commented on August 22, 2024
Reproducing Paper Results

from graphillion.

Comments (4)

takemaru avatar takemaru commented on August 22, 2024

Why don't you ask Prof Minato? I'm not a co-author of the paper.

from graphillion.

seanlaw avatar seanlaw commented on August 22, 2024

Thank you @takemaru. I had already reached out to both Prof Minato and Prof Kawahara and received the following response:

The code has already been implemented in the BDDCT class in SAPPOROBDD package, and will be implemented in graphillion soon.

Since I am not familiar with the C programming language and, without proper documentation, it is not clear how to use SAPPOROBDD. Thus, I was hoping that I could use/construct ZDDs through Graphillion's extension into SAPPOROBDD. However, I am confused since BDD/ZDD directed acyclic graphs (DAG) but, in the Graphillion documentation it states that:

Graphillion supports undirected graphs only

If Graphillion uses ZDDs, which are DAGs, then are you able to help me better understand why Graphillion only supports undirected graphs (even though it uses ZDD DAGs)? This is not so clear to me.

Or to ask my question differently, is it possible to use Graphillion's Python interface to create a ZDD that can then be used to solve a knapsack problem?

Thank you for your time and patience!

from graphillion.

takemaru avatar takemaru commented on August 22, 2024

Since Graphillion is designed for graph problems, it is not suitable for knapsack problems.
If you want a Python-based ZDD library, please try https://github.com/tulip-control/dd

from graphillion.

seanlaw avatar seanlaw commented on August 22, 2024

After exchanging a few emails with @junkawahara, the methods proposed in the paper have been implemented in v1.7rc and a simple reproducible example was kindly provided:

For the knapsack problem, it is suitable to use "setset" class,
which is similar to GraphSet but represents sets of sets.

The following is a piece of sample code.

from graphillion import setset

items = [1, 2, 3, 4, 5] # item id (arbitrary)
weights = [3, 2, 7, 5, 1] # item weights
cost_bound = 6 # capacity of the bin

cost_dic = {} # dictionary whose key is an item and whose value is item's weight
for i in range(len(items)):
     cost_dic[items[i]] = weights[i]

setset.set_universe(items) # must be called

power_set = setset({}) # power set (all the combinations of the items)

sets_le_6 = power_set.cost_le(weights, cost_bound) # sets_le_6 is an object of setset class.

Thank you @junkawahara and @takemaru for your help, time, and patience. Please let me know if this example would be worth adding to the Wiki and I can submit a PR when the release candidate is merged.

from graphillion.

Related Issues (20)

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.