Thread: Looking for appropriate container

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by brewbuck View Post
    Why are you calling it minimax then?
    Because the algorithm is called minmax, no? Alpha-beta pruning is an optimization.

    I have collected some statistics. I do get cutoffs. The number of cutoffs is roughly 4% off the total examined nodes. What does that actually mean, though? I really have no idea. Since I don't count the total nodes when getting a cache hit and I don't know how many nodes are cut off from the alpha-beta, I cannot count how many nodes are actually pruned.

    But this ordering... I'm afraid I don't know why it would help or how it works.
    It is just my first AI algorithm.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Elysia View Post
    I have collected some statistics. I do get cutoffs. The number of cutoffs is roughly 4% off the total examined nodes. What does that actually mean, though? I really have no idea. Since I don't count the total nodes when getting a cache hit and I don't know how many nodes are cut off from the alpha-beta, I cannot count how many nodes are actually pruned.
    Counting the exact number of nodes pruned is really looking at it in too fine detail. Just estimate it. If you know the approximate branching factor B for a given move sequence number you can just take it B^(D-1) to predict how many moves would be evaluated at depth D. So if you make a cutoff at depth D then you saved approximate B^(D-1) evaluations.

    But this ordering... I'm afraid I don't know why it would help or how it works.
    It is just my first AI algorithm.
    The ordering tries to put high-value moves first, so that they will cause earlier cutoffs. As these early cutoffs stack on top of each other at various depths, the effect is to reduce the branching factor from B to approximately sqrt(B) which lets you search twice as deep in the same amount of time. The estimates have to be legitimate, not just random values. That's where the table comes in -- as you are filling in the table you are storing the last-known values of those positions and you can use those to order the moves in a following iteration.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. iterator to unspecified container?
    By StainedBlue in forum C++ Programming
    Replies: 16
    Last Post: 06-04-2010, 05:02 AM
  2. sorting container
    By l2u in forum C++ Programming
    Replies: 6
    Last Post: 09-01-2007, 01:12 PM
  3. stl container to store more than 1 type
    By sujeet1 in forum C++ Programming
    Replies: 7
    Last Post: 05-09-2007, 04:10 AM
  4. Replies: 1
    Last Post: 01-23-2006, 07:12 PM
  5. Linked List Queue Implementation help
    By Kenogu Labz in forum C++ Programming
    Replies: 8
    Last Post: 09-21-2005, 10:14 AM