np-complete


Is this an NP problem?


first off I'm going to say I don't know a whole lot about theory and such. But I was wondering if this was an NP or NP-complete problem. It specifically sounds like a special case of the subset sum problem.
Anyway, there's this game I've been playing recently called Alchemy which prompted this thought. Basically you start off with 4 basic elements and combine them to make other elements.
So, for instance, this is a short "recipe" if you will for making elements
fire=basic element
water=basic element
air=basic element
earth=basic element
sand=earth+earth
glass=sand+fire
energy=fire+air
lightbulb=energy+glass
So let's say a computer could create only the 4 basic elements, but it could create multiple sets of the elements. So you write a program to make any element by combining other elements. How would this program process the list the create a lightbulb?
It's clearly fire+air=energy, earth+earth=sand, sand+fire=glass, energy+glass=lightbulb.
But I can't think of any way to write a program to process a list and figure that out without doing a brute force type method and going over every element and checking its recipe.
Is this an NP problem? Or am I just not able to figure this out?
How would this program process the list the create a lightbulb?
Surely you just run the definitions backwards; e.g.
Creating a lightbulb requires 1 energy + 1 glass
Creating an energy requires 1 fire + 1 air
and so on. This is effectively a simple tree walk.
OTOH, if you want the computer to figure out that energy + glass means lightbulb (rather than "blob of molten glass"), you've got no chance of solving the problem. You probably couldn't get 2 gamers to agree that energy + glass = lightbulb!
You can easily model your problem as a graph and look for a solution with any complete search algorithm. If you don't have any experience, it might also help to look into automated planning. I'm linking to that text because it also features an introduction on complexity and search algorithms.

Related Links

Grid dominating set is NP-complete
Given a graph with n vertices and m edges, does it contain a simple cycle of length ⌈n/2⌉?
NP-complete or NP-hard?
Why using linear integer programming (ILP) though it is NP-Complete?
Prove NP-Completeness of generating 2 shortest routes over given edge grouping constraints?
Reduction to Clique prob
Approximation Algorithm between two NP compete problems
Is it possible to find the probability to a solution of NP-complete problems?
Knapsack for each weight having multiple values - Is it possible to solve?
Reduction from Maximum independent set to Dominating set to prove the Dominating set is NP-complete
How I can prove that 2-CNF is not NP-complete?
When NP complete becomes NP hard
Can it be proven no polynomial algorithm exists for an NP-Complete prob.?
Effect of number base when proving NP completeness of numerical problems
How to reduce 3COLOR to 3SAT?
proof NP-complete

Categories

HOME
vim
client
activiti
pycharm
hp-exstream
raspberry-pi
session
xmpp
sqlite-net-extensions
programming-languages
infragistics
microservices
v8
cross-browser
blueprintjs
ojdbc
yum
flyway4
fancybox-3
midi
mapserver
collectd
google-cloud-spanner
php-7.1
footer
pugjs
jqwidget
immutable.js
ml
orleans
ehcache
bootstrap-tour
language-agnostic
captiveportal
android-widget
qhull
semantic-analysis
django-storage
assistant
bpel
tinymce-4
semantic-versioning
azure-sql-database
accelerate-framework
http-referer
atl
mapbox-gl
suricata
bootstrapper
particles.js
optix
hp-ux
avro4s
businessworks
thin
auto-update
prolog-setof
worker-thread
google-perftools
media-player
windows-iot-core-10
bind9
background-service
nested-sets
visual-c++-2008
static-ip-address
heidisql
android-textview
fody
trash
firebaseui
ready-api
bluegiga
php-parse-error
system.management
photobucket
srand
cartesian-product
cannon.js
twirl
graph-drawing
fluid-dynamics
census
umbraco6
website-monitoring
coldbox
asp.net-web-api-odata
flask-cors
centos5
fmod
.aspxauth
quartz-graphics
pygit2
free-variable
simba
broken-links
labwindows
netdna-api
mercurial-server
pydot
subgurim-maps
javax.script
file-comparison
ecl
floating
fluent-interface
h.323
sproutcore-2
routedevent
fixed-width
database-management
avatar
yagni
post-build
lzh

Resources

Encrypt Message