Comments (4)
Why don't you ask Prof Minato? I'm not a co-author of the paper.
from graphillion.
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.
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.
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)
- The Question about connection with networkX HOT 1
- Store Path Counts in Graphillion HOT 8
- Graphillion and the exact cover problem HOT 5
- ImportError: undefined symbol: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev HOT 4
- What forces the paths / cycles to have one connected component? HOT 3
- Feature request: minimum cut function HOT 2
- GraphSet([[]]).min_iter() should return the set consisting of the empty graph but not so. HOT 1
- pip install / python setup.py build is not working HOT 1
- how can I call zdd library from graphillion HOT 4
- setset load does not work problem HOT 15
- load after dump does not work HOT 1
- Generating nondisjoint set families HOT 3
- Creating a Graphset Using a Toy Example HOT 1
- Limiting amount of results in creation methods HOT 1
- Is the tutorial module still included with Graphillion? HOT 2
- Find All Paths With Cumulative Edge Weight Upper Limit HOT 1
- Add to `conda-forge` to allow installation with `conda`?
- GraphSet.reliability raises a type error for probabilities in integer (0 or 1)
- Extracting the ZDD ala Shen et al. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphillion.