• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
  • entries
    33
  • comments
    37
  • views
    38371

P and NP: Algorithms Part One

Sign in to follow this  
Followers 0
superman3275

1168 views

I know I keep on going for two months and then saying "I'm not going to do it again!", however at least I have a legitimate reason this time. My computer broke. Completely. So, I bought the amazingly awesome, beefy, and fast Lenovo Y500 for development. I'm opening it on Monday smile.png!

Now, I'm using a temporary laptop for small development, and I'm updating you:

Firstly, my (first) software product is being released soon. I haven't told you guys about it yet, however it is PyText! (That's not the real domain name, however the normal one is currently down so yeah smile.png!)

Secondly, I've been working on Jarvis.

Before I start, let me say how much I'm enjoying Python. Everything is so easy and simple. No linker problems or weird compiler bugs. Everything is a module away (from, maybe, PyPi smile.png). Python is so simple yet powerful, it has everything I like about a programming language. The syntax really is just beautiful to look at.

I'm working my way through Code-Academy's Python track and Learn Python The Hard Way, after which I'm reading one of the books about PyGame development, after which I'm reading a Python Data Structures book. After which I'll probably tackle a functional programming language smile.png!

Jarvis is my personal voice-assistant. I've integrated him with the Wolfram-Alpha API and he's using PySpeech (on Windows) and CMU Sphinx (on Linux) for voice recognition. He is awesome. He can do everything Siri can do (wolfram-alpha), except he's on a desktop and tailored for me.

I'm currently getting a Raspberry PI and hooking up hidden microphones around my room. The PI will just be running the script (I also am going to be interfacing my script with a set of LCD lights which I'm also hooking up to show the status of Jarvis, what he's currently doing, etc.)!

I will be able to walk into my room and this will happen (with CMU Sphinx rather than PySpeech it's even better because of CMU Sphinx's grammar):

Me: "Jarvis"
PI: "Yes sir?"
Me: "What temperature is it in Arizona? It's where my parents live"
(CMU Sphinx can filter out the "It's where my parents live part")
PI: "I'm not sure, let me check. Oh yes, here it is. It's 36 Degrees Celsius, sir"

I can't wait until it's hooked up! (I'm already testing on my temporary laptop)

Now onto P and NP.

[hr]

When discussing algorithms, we find that P and NP constantly come up. A key part of understanding algorithms is understanding both how they scale and how hard they are to solve. P and NP help us answer both of these questions.

Multiplication is considered an P problem. Computers can perform multiplication rather quickly, and it is very easy for them to solve a multiplication problem. Multiplication is a P problem because no matter how much more complex it gets, the time it takes to solve only increases by little. It is considered to be upper-bounded by a polynomial expression.

What does this mean?

It means that:

Some polynomial is greater than the running time of the algorithm.

In math:

If we have a polynomial z and an equation f(x), z upper bounds f(x) if z >= f(x) for all possible values of x.

An NP problem would be finding factors of a number. As the number gets bigger the problem gets harder and harder to solve.

Finding the factors of 20 is trivial, however finding the factors of a 100 digit behemoth? It often takes at least twenty years to solve simple factoring problems like that. In retrospect, for a computer (not considering the size of values. This is considering that this computer is equipped to store numbers with any amount of digits and that there is enough RAM) 20 * 20 relatively the same as a one-hundred digit number squared.

Now that we understand P and NP, what is NP-Complete?

Take the clique problem:

fig8a.gif

Try to find the largest "clique" in this. That is, a group of dots all connected together in a polygon:

monopolar.png

The green highlighted groups are cliques. They form polygons.

Finding a clique in a group of, say, 5 dots seems easy, however what about 1000 dots? It's basically impossible.

The clique problem is NP, however it has another interesting characteristic pushing it beyond NP:

We can put any NP problem through a "transformer" and turn it into a clique problem. This means we can turn a factoring problem into a clique problem and so forth.

This means the clique problem is NP - Complete. If we find a way to solve it fast enough to where it becomes an P problem, then we will have turned every NP (Hard to solve) problem into a P problem. This is a huge deal.

The even more interesting thing is that scientists believe that there's no way to turn an NP-Complete problem into a P problem, or that P != NP, however they can't figure out how to prove it. So, no one really knows if P = NP or not.

Cheers :)!

0
Sign in to follow this  
Followers 0


0 Comments


There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now