找回密码
 注册
搜索
查看: 846|回复: 0

[哲史艺丛] Pac-Man is NP-hard, same as traveling salesman problem

[复制链接]
发表于 2012-1-27 01:59 PM | 显示全部楼层 |阅读模式


http://www.extremetech.com/gamin ... ng-salesman-problem
http://arxiv.org/abs/1201.4995

An Italian researcher with a penchant for retro games — or perhaps just looking for an excuse to play games in the name of science! — has used computational complexity theory to decide, once and for all, just how hard video games are. In a truly epic undertaking, Giovanni Viglietta of the University of Pisa has worked out the theoretical difficulty of 13 old games, including Pac-Man, Doom, Lemmings, Prince of Persia, and Boulder Dash.

To begin with, Viglietta defines a few basic gameplay mechanics and sorts them into categories of complexity theory. Location traversal and single-use paths, ala Pac-Man, is NP-hard. Pressure plates, ala Prince of Persia or Portal, is PSPACE-hard if there are two pressure plates, and NP-hard if only one is required to open a door. In the case of switches, one switch is P-hard, two is NP-hard, and three or more is PSPACE-hard.

Viglietta then uses these characteristics to classify each of the 13 games. Boulder Dash, which involves traversing a map strewn with boulders, is NP-hard. Prince of Persia, thanks to its pressure plates, is PSPACE-complete. Doom, with its multiple switches, is PSPACE-hard (and Viglietta claims that most other FPSes and adventure games are the same).

Lemmings, NP-hardLemmings proved to be a bit harder to classify: If you just use Bashers and Miners, it is a traversal problem and NP-hard. Viglietta doesn’t try to tackle the complexity of using other types of lemming. A similar stretch allows him to classify StarCraft as NP-hard, where by each player is trying to produce the right units to allow him to traverse a certain path

If you’ve never heard of computational complexity theory, the best known example is the traveling salesman problem (TSP), which is NP-hard. In the TSP, you have to devise the most optimal route that visits a list of locations. This can be optimized as the shortest route, the fastest, the path of least resistance, and so on. Variants of the TSP are used to optimize transport systems, CPU designs, computer algorithms, and more. PSPACE represents much more complex problems and puzzles that takes in games like Mahjong, Reversi, or Doom. If you want to know more, hit up Wikipedia — but be warned, complexity theory is a bit of a beast.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|www.hutong9.net

GMT-5, 2025-6-29 04:02 AM , Processed in 0.072464 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表