Search Results

Search found 40 results on 2 pages for 'pruning'.

Page 1/2 | 1 2  | Next Page >

  • Pruning: When to Stop?

    - by cam
    When does pruning stop being efficient in a depth-first search? I've been working on an efficient method to solve the N-Queens problem and I'm looking at pruning for the first time. I've implemented it for the first two rows, but when does it stop being efficient? How far should I prune to?

    Read the article

  • Ruby: implementing alpha-beta pruning for tic-tac-toe

    - by DerNalia
    So, alpha-beta pruning seems to be the most efficient algorithm out there aside from hard coding (for tic tac toe). However, I'm having problems converting the algorithm from the C++ example given in the link: http://www.webkinesia.com/games/gametree.php #based off http://www.webkinesia.com/games/gametree.php # (converted from C++ code from the alpha - beta pruning section) # returns 0 if draw LOSS = -1 DRAW = 0 WIN = 1 @next_move = 0 def calculate_ai_next_move score = self.get_best_move(COMPUTER, WIN, LOSS) return @next_move end def get_best_move(player, alpha, beta) best_score = nil score = nil if not self.has_available_moves? return false elsif self.has_this_player_won?(player) return WIN elsif self.has_this_player_won?(1 - player) return LOSS else best_score = alpha NUM_SQUARES.times do |square| if best_score >= beta break end if self.state[square].nil? self.make_move_with_index(square, player) # set to negative of opponent's best move; we only need the returned score; # the returned move is irrelevant. score = -get_best_move(1-player, -beta, -alpha) if (score > bestScore) @next_move = square best_score = score end undo_move(square) end end end return best_score end the problem is that this is returning nil. some support methods that are used above: WAYS_TO_WIN = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8],[0, 4, 8], [2, 4, 6]] def has_this_player_won?(player) result = false WAYS_TO_WIN.each {|solution| result = self.state[solution[0]] if contains_win?(solution) } return (result == player) end def contains_win?(ttt_win_state) ttt_win_state.each do |pos| return false if self.state[pos] != self.state[ttt_win_state[0]] or self.state[pos].nil? end return true end def make_move(x, y, player) self.set_square(x,y, player) end

    Read the article

  • pcap stream rotation and pruning

    - by pilcrow
    Some of my servers collect a lot of packet data. Is there a utility (or patch to tcpdump(1)) to log a pcap stream to disk which: Rotates based on size of data written Prunes written files, keeping only the N most recent Does not re-use output filenames Is self-contained (Ruling out, e.g., a rotation with external pruning via crond(8)+tmpwatch(8)) Basically I want a multilog or svlogd that groks the pcap record format. The -W filecount option of tcpdump-4.0.0 "prunes" by recycling old filenames, which violates #3 above, forcing me to consult mtimes to determine recency and providing no guarantees against surprise truncation of the log file. The -G option introduces strftime(2)-specifier support in output filenames, which would give me at least second-precision in file names, but I can't figure out how to get pruning to work with this scheme.

    Read the article

  • Creating hard drive backup images efficiently

    - by Arrieta
    We are in the process of pruning our directories to recuperate some disk space. The 'algorithm' for the pruning/backup process consists of a list of directories and, for each one of them, a set of rules, e.g. 'compress *.bin', 'move *.blah', 'delete *.crap', 'leave *.important'; these rules change from directory to directory but are well known. The compressed and moved files are stored in a temporary file system, burned onto a blue ray, tested within the blue ray, and, finally, deleted from their original locations. I am doing this in Python (basically a walk statement with a dictionary with the rules for each extension in each folder). Do you recommend a better methodology for pruning file systems? How do you do it? We run on Linux.

    Read the article

  • Pruning data for better viewing on loglog graph - Matlab

    - by Geodesic
    Hi Guys, just wondering if anyone has any ideas about an issue I'm having. I have a fair amount of data that needs to be displayed on one graph. Two theoretical lines that are bold and solid are displayed on top, then 10 experimental data sets that converge to these lines are graphed, each using a different identifier (eg the + or o or a square etc). These graphs are on a log scale that goes up to 1e6. The first few decades of the graph (< 1e3) look fine, but as all the datasets converge ( 1e3) it's really difficult to see what data is what. There's over 1000 data points points per decade which I can prune linearly to an extent, but if I do this too much the lower end of the graph will suffer in resolution. What I'd like to do is prune logarithmically, strongest at the high end, working back to 0. My question is: how can I get a logarithmically scaled index vector rather than a linear one? My initial assumption was that as my data is lenear I could just use a linear index to prune, which lead to something like this (but for all decades): //%grab indicies per decade ind12 = find(y >= 1e1 & y <= 1e2); indlow = find(y < 1e2); indhigh = find(y > 1e4); ind23 = find(y >+ 1e2 & y <= 1e3); ind34 = find(y >+ 1e3 & y <= 1e4); //%We want ind12 indexes in this decade, find spacing tot23 = round(length(ind23)/length(ind12)); tot34 = round(length(ind34)/length(ind12)); //%grab ones to keep ind23keep = ind23(1):tot23:ind23(end); ind34keep = ind34(1):tot34:ind34(end); indnew = [indlow' ind23keep ind34keep indhigh']; loglog(x(indnew), y(indnew)); But this causes the prune to behave in a jumpy fashion obviously. Each decade has the number of points that I'd like, but as it's a linear distribution, the points tend to be clumped at the high end of the decade on the log scale. Any ideas on how I can do this?

    Read the article

  • A* Jump Point Search - how does pruning really work?

    - by DeadMG
    I've come across Jump Point Search, and it seems pretty sweet to me. However, I'm unsure as to how their pruning rules actually work. More specifically, in Figure 1, it states that we can immediately prune all grey neighbours as these can be reached optimally from the parent of x without ever going through node x However, this seems somewhat at odds. In the second image, node 5 could be reached by first going through node 7 and skipping x entirely through a symmetrical path- that is, 6 -> x -> 5 seems to be symmetrical to 6 -> 7 -> 5. This would be the same as how node 3 can be reached without going through x in the first image. As such, I don't understand how these two images are not entirely equivalent, and not just rotated versions of each other. Secondly, I'd like to understand how this algorithm could be generalized to a three-dimensional search volume.

    Read the article

  • How to prune data set by frequency to conform to paper's description

    - by sakura90
    The MovieLens data set provides a table with columns: userid | movieid | tag | timestamp I have trouble reproducing the way they pruned the MovieLens data set used in: Tag Informed Collaborative Filtering, by Zhen, Li and Young In 4.1 Data Set of the above paper, it writes "For the tagging information, we only keep those tags which are added on at least 3 distinct movies. As for the users, we only keep those users who used at least 3 distinct tags in their tagging history. For movies, we only keep those movies that are annotated by at least 3 distinct tags." I tried to query the database: select TMP.userid, count(*) as tagnum from (select distinct T.userid as userid, T.tag as tag from tags T) AS TMP group by TMP.userid having tagnum >= 3; I got a list of 1760 users who labeled 3 distinct tags. However, some of the tags are not added on at least 3 distinct movies. Any help is appreciated.

    Read the article

  • Autopruning after a specified amount of row are created?

    - by Rob
    Basic question, sorry. Basically, I have a script that creates a MySQL entry each time someone visits the page. A logging script. However, I want to make it autoprune after, say, 100 visits. For example in pseudo code: if amount of rows > 100 { delete rows 1+ until amount of rows == 100 } So in a nutshell, each time a new row is added after 100, it needs to automatically remove the row with the smallest id (My primary key).

    Read the article

  • Anatomy of a serialization killer

    - by Brian Donahue
    As I had mentioned last month, I have been working on a project to create an easy-to-use managed debugger. It's still an internal tool that we use at Red Gate as part of product support to analyze application errors on customer's computers, and as such, should be easy to use and not require installation. Since the project has got rather large and important, I had decided to use SmartAssembly to protect all of my hard work. This was trivial for the most part, but the loading and saving of results was broken by SA after using the obfuscation, rendering the loading and saving of XML results basically useless, although the merging and error reporting was an absolute godsend and definitely worth the price of admission. (Well, I get my Red Gate licenses for free, but you know what I mean!)My initial reaction was to simply exclude the serializable results class and all of its' members from obfuscation, and that was just dandy, but a few weeks on I decided to look into exactly why serialization had broken and change the code to work with SA so I could write any new code to be compatible with SmartAssembly and save me some additional testing and changes to the SA project.In simple terms, SA does all that it can to prevent serialization problems, for instance, it will not obfuscate public members of a DLL and it will exclude any types with the Serializable attribute from obfuscation. This prevents public members and properties from being made private and having the name changed. If the serialization is done inside the executable, however, public members have the access changed to private and are renamed. That was my first problem, because my types were in the executable assembly and implemented ISerializable, but did not have the Serializable attribute set on them!public class RedFlagResults : ISerializable        {        }The second problem caused by the pruning feature. Although RedFlagResults had public members, they were not truly properties, and used the GetObjectData() method of ISerializable to serialize the members. For that reason, SA could not exclude these members from pruning and further broke the serialization. public class RedFlagResults : ISerializable        {                public List<RedFlag.Exception> Exceptions;                 #region ISerializable Members                 public void GetObjectData(SerializationInfo info, StreamingContext context)                {                                info.AddValue("Exceptions", Exceptions);                }                 #endregionSo to fix this, it was necessary to make Exceptions a proper property by implementing get and set on it. Also, I added the Serializable attribute so that I don't have to exclude the class from obfuscation in the SA project any more. The DoNotPrune attribute means I do not need to exclude the class from pruning.[Serializable, SmartAssembly.Attributes.DoNotPrune]        public class RedFlagResults        {                public List<RedFlag.Exception> Exceptions {get;set;}        }Similarly, the Exception class gets the Serializable and DoNotPrune attributes applied so all of its' properties are excluded from obfuscation.Now my project has some protection from prying eyes by scrambling up the code so it's harder to reverse-engineer, without breaking anything. SmartAssembly has also provided the benefit of merging so that the end-user doesn't need to extract all of the DLL files needed by RedFlag into a directory, and can be run directly from the .zip archive. When an error occurs (hey, I'm only human!), an exception report can be sent to me so I can see what went wrong without having to, er, debug the debugger.

    Read the article

  • Cisco: changing VTP mode server/client to transparent

    - by J. Smith
    I have around 40 L2 switches (2960, 3560, 3500, 3750) running in VTP client mode and one L3 switch (6500) running in VTP server mode, all connected together. I would like to switch everything in VTP transparent mode without any interruption of service. I've already test on a poc version with 3 switches (Catalyst 2950, 3560 and 3750). Using serial and SSH connection, it is seems working but i'm not sure it is enough representative compare to the real network. Knowing that the VTP Pruning is enabled, I am wondering what would be the best procedure to proceed the changement. I've read that we could lost connection by keeping it enabled. Should I change the server or clients first? Is it important to change the VTP domain and VTP Pruning parameters?

    Read the article

  • Getting started with Oracle Database In-Memory Part III - Querying The IM Column Store

    - by Maria Colgan
    In my previous blog posts, I described how to install, enable, and populate the In-Memory column store (IM column store). This weeks post focuses on how data is accessed within the IM column store. Let’s take a simple query “What is the most expensive air-mail order we have received to date?” SELECT Max(lo_ordtotalprice) most_expensive_order FROM lineorderWHERE  lo_shipmode = 5; The LINEORDER table has been populated into the IM column store and since we have no alternative access paths (indexes or views) the execution plan for this query is a full table scan of the LINEORDER table. You will notice that the execution plan has a new set of keywords “IN MEMORY" in the access method description in the Operation column. These keywords indicate that the LINEORDER table has been marked for INMEMORY and we may use the IM column store in this query. What do I mean by “may use”? There are a small number of cases were we won’t use the IM column store even though the object has been marked INMEMORY. This is similar to how the keyword STORAGE is used on Exadata environments. You can confirm that the IM column store was actually used by examining the session level statistics, but more on that later. For now let's focus on how the data is accessed in the IM column store and why it’s faster to access the data in the new column format, for analytical queries, rather than the buffer cache. There are four main reasons why accessing the data in the IM column store is more efficient. 1. Access only the column data needed The IM column store only has to scan two columns – lo_shipmode and lo_ordtotalprice – to execute this query while the traditional row store or buffer cache has to scan all of the columns in each row of the LINEORDER table until it reaches both the lo_shipmode and the lo_ordtotalprice column. 2. Scan and filter data in it's compressed format When data is populated into the IM column it is automatically compressed using a new set of compression algorithms that allow WHERE clause predicates to be applied against the compressed formats. This means the volume of data scanned in the IM column store for our query will be far less than the same query in the buffer cache where it will scan the data in its uncompressed form, which could be 20X larger. 3. Prune out any unnecessary data within each column The fastest read you can execute is the read you don’t do. In the IM column store a further reduction in the amount of data accessed is possible due to the In-Memory Storage Indexes(IM storage indexes) that are automatically created and maintained on each of the columns in the IM column store. IM storage indexes allow data pruning to occur based on the filter predicates supplied in a SQL statement. An IM storage index keeps track of minimum and maximum values for each column in each of the In-Memory Compression Unit (IMCU). In our query the WHERE clause predicate is on the lo_shipmode column. The IM storage index on the lo_shipdate column is examined to determine if our specified column value 5 exist in any IMCU by comparing the value 5 to the minimum and maximum values maintained in the Storage Index. If the value 5 is outside the minimum and maximum range for an IMCU, the scan of that IMCU is avoided. For the IMCUs where the value 5 does fall within the min, max range, an additional level of data pruning is possible via the metadata dictionary created when dictionary-based compression is used on IMCU. The dictionary contains a list of the unique column values within the IMCU. Since we have an equality predicate we can easily determine if 5 is one of the distinct column values or not. The combination of the IM storage index and dictionary based pruning, enables us to only scan the necessary IMCUs. 4. Use SIMD to apply filter predicates For the IMCU that need to be scanned Oracle takes advantage of SIMD vector processing (Single Instruction processing Multiple Data values). Instead of evaluating each entry in the column one at a time, SIMD vector processing allows a set of column values to be evaluated together in a single CPU instruction. The column format used in the IM column store has been specifically designed to maximize the number of column entries that can be loaded into the vector registers on the CPU and evaluated in a single CPU instruction. SIMD vector processing enables the Oracle Database In-Memory to scan billion of rows per second per core versus the millions of rows per second per core scan rate that can be achieved in the buffer cache. I mentioned earlier in this post that in order to confirm the IM column store was used; we need to examine the session level statistics. You can monitor the session level statistics by querying the performance views v$mystat and v$statname. All of the statistics related to the In-Memory Column Store begin with IM. You can see the full list of these statistics by typing: display_name format a30 SELECT display_name FROM v$statname WHERE  display_name LIKE 'IM%'; If we check the session statistics after we execute our query the results would be as follow; SELECT Max(lo_ordtotalprice) most_expensive_order FROM lineorderWHERE lo_shipmode = 5; SELECT display_name FROM v$statname WHERE  display_name IN ('IM scan CUs columns accessed',                        'IM scan segments minmax eligible',                        'IM scan CUs pruned'); As you can see, only 2 IMCUs were accessed during the scan as the majority of the IMCUs (44) in the LINEORDER table were pruned out thanks to the storage index on the lo_shipmode column. In next weeks post I will describe how you can control which queries use the IM column store and which don't. +Maria Colgan

    Read the article

  • Explain BFS and DFS in terms of backtracking

    - by HH
    Wikipedia about DFS Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as possible along each branch before backtracking. So is BFS? "an algorithm that choose a starting node, checks all nodes -- backtracks --, chooses the shortest path, chose neighbour nodes -- backtracks --, chose the shortest path -- finally finds the optimal path because of traversing each path due to continuos backtracking. Regex, find's pruning -- backtracking? The term backtracking confuseses due to its variety of use. UNIX find's pruning an SO-user explained with backtracking. Regex Buddy uses the term "catastrophic backtracking" if you do not limit the scope of your Regexes. It seems to be too wide umbrella-term. So: how do you define "Backtracking" GRAPH-theoretically? what is "backtracking" in BFS and DFS?

    Read the article

  • TicTacToe strategic reduction

    - by NickLarsen
    I decided to write a small program that solves TicTacToe in order to try out the effect of some pruning techniques on a trivial game. The full game tree using minimax to solve it only ends up with 549,946 possible games. With alpha-beta pruning, the number of states required to evaluate was reduced to 18,297. Then I applied a transposition table that brings the number down to 2,592. Now I want to see how low that number can go. The next enhancement I want to apply is a strategic reduction. The basic idea is to combine states that have equivalent strategic value. For instance, on the first move, if X plays first, there is nothing strategically different (assuming your opponent plays optimally) about choosing one corner instead of another. In the same situation, the same is true of the center of the walls of the board, and the center is also significant. By reducing to significant states only, you end up with only 3 states for evaluation on the first move instead of 9. This technique should be very useful since it prunes states near the top of the game tree. This idea came from the GameShrink method created by a group at CMU, only I am trying to avoid writing the general form, and just doing what is needed to apply the technique to TicTacToe. In order to achieve this, I modified my hash function (for the transposition table) to enumerate all strategically equivalent positions (using rotation and flipping functions), and to only return the lowest of the values for each board. Unfortunately now my program thinks X can force a win in 5 moves from an empty board when going first. After a long debugging session, it became apparent to me the program was always returning the move for the lowest strategically significant move (I store the last move in the transposition table as part of my state). Is there a better way I can go about adding this feature, or a simple method for determining the correct move applicable to the current situation with what I have already done?

    Read the article

  • Why should I prune old objects from Active Directory?

    - by Nic
    What is the point of pruning old objects from Active Directory, especially computer accounts? If a computer is wiped or destroyed, then the stale computer account doesn't pose any security risk because it can't be used any more. And I can't imagine that stale objects affect performance very much, because if they aren't being changed then they aren't being replicated. So, what is the real motivation to keep Active Directory clean of stale objects?

    Read the article

  • Reversi/Othello early-game evaluation function

    - by Vladislav Il'ushin
    I've written my own Reversi player, based on the MiniMax algorithm, with Alpha-Beta pruning, but in the first 10 moves my evaluation function is too slow. I need a good early-game evaluation function. I'm trying to do it with this matrix (corresponding to the board) which determines how favourable that square is to have: { 30, -25, 10, 5, 5, 10, -25, 30,}, {-25, -25, 1, 1, 1, 1, -25, -25,}, { 10, 1, 5, 2, 2, 5, 1, 10,}, { 5, 1, 2, 1, 1, 2, 1, 5,}, { 5, 1, 2, 1, 1, 2, 1, 5,}, { 10, 1, 5, 2, 2, 5, 1, 10,}, {-25, -25, 1, 1, 1, 1, -25, -25,}, { 30, -25, 10, 5, 5, 10, -25, 30,},}; But it doesn't work well. Have you even written an early-game evaluation function for Reversi?

    Read the article

  • My website links now include DirectX categories

    - by Michael B. McLaughlin
    I’ve done a bit of overdue updates to my website. The links page - http://www.bobtacoindustries.com/Developers/Links  - now includes DirectX links. I’ve also updated all of the links that were broken in the recent changes to the App Hub site. If you have any good links you think I’m missing, let me know. I haven’t had a chance to do any dead link checking & pruning yet so there might be some links that go to the wrong place or go nowhere at all. That’s the problem with link repositories; maintenance of them is quite a bit of work. But hopefully I’ll find some time to do that soon.

    Read the article

  • iPhone GUI for real-time log message display

    - by zer0stimulus
    My goal is to have a screen on my GUI dedicated to logging real-time messages generated by my internal components. A certain limit will be set on the log messages so that older messages are pruned. I'm thinking about implementing using a UITextView with a NSMutableString to store the output. I would have to perform manual pruning somehow on the NSMutableString object. Is a better way to implement this?

    Read the article

  • m-estimate for continuous values

    - by Null
    I'm building a custom regression tree and want to use m-estimate for pruning. Does anyone know how to calculate that. http://www.ailab.si/blaz/predavanja/UISP/slides/uisp07-RegTrees.ppt might help (slide 12, how should Em look like?)

    Read the article

  • Exchange Management Console Listing Extra Servers

    - by Zak G
    I recently decommissioned an Old Exchange 2003 server. Prior to the decommissioning, the environment consisted of 2 EXCH 2010 and that one EXCH 2003 server. I went through all the steps listed in Microsoft documents and online in how to remove the server completely (pruning the AD and all that jazz). When I go to Exchange Management Console it still lists 3 total servers in the "Server Summary" column in the Organizational Health tab. When I click manage servers, it only lists the 2 EXCH 2010 servers. I am aware this is only a cosmetic issue but I would appreciate it if anyone can share some advice on how to fix the issue.

    Read the article

  • background screen recording tool

    - by misha nesterenko
    I am searching for a tool that allows background recording of my pc screen. I it is nothing like a spy tool, I just need to be able to check what I was doing at the some time in the past. Small impact on the system, and relatively small size of recordings, as it is supposed to run all time pc is turned on. Some recording management as auto pruning of recordings older than x days. UPD This is not a problem if some scripting is necessary to achieve what is described in the question. So it could be a command line recording tool which could be used from batch, bash (cygwin, mingw) scripts.

    Read the article

  • Better Flex memory profiling tools

    - by verveguy
    Does anyone know of any better tools that the Flex Builder Profiler? I've googled and googled to no avail. While the FB tools are OK for small apps / small leak situations, they're nowhere near adequate for wading through the thicket of object references that can arise in a large scale Flex app (that is leaking memory heavily). In particular, any reasonably complex view structure ends up with huge numbers of parent/child object references to the top level view - none of which are at all relevant to finding the one or two refs from outside the parent child subgraph that are causing the whole bolus to be non-GC'able. If no one has any better suggestions, I'm seriously considering writing a tool to parse the saved profile dumps that Flex Builder can generate so that I can do my own "graph pruning" to find the important refs. If I go this route, collaboration would be welcome!

    Read the article

  • Minimax algorithm: Cost/evaluation function?

    - by Dave
    Hi guys, A school project has me writing a Date game in C++ (example at http://www.cut-the-knot.org/Curriculum/Games/Date.shtml) where the computer player must implement a Minimax algorithm with alpha-beta pruning. Thus far, I understand what the goal is behind the algorithm in terms of maximizing potential gains while assuming the opponent will minify them. However, none of the resources I read helped me understand how to design the evaluation function the minimax bases all it's decisions on. All the examples have had arbitrary numbers assigned to the leaf nodes, however, I need to actually assign meaningful values to those nodes. Intuition tells me it'd be something like +1 for a win leaf node, and -1 for a loss, but how do intermediate nodes evaluate? Any help would be most appreciated.

    Read the article

  • Java library for HTML analysis

    - by Raj
    Hi, (I've seen similar questions, but I think none of them cater to my specific needs, hence...) I would like to know if there is a Java library for analysis of real-world (read: incomplete, ill-formed) HTML. By analysis, I mean things like: figuring out the most prominent color in an HTML chunk changing that color to some other color (hence, has to support modification of the HTML as well) pruning out unwanted tags fixing up the HTML to result in a well formed HTML snippet Parts of the last two are done by libraries such as Jericho, and jTidy. 'Plugins' on top of these would be great. Thanks in advance!

    Read the article

  • How do i start with Gomoku?

    - by firstTry
    I read about Gomoku that it can be implemented using Minimax and Alpha-Beta Pruning algorithms. So, i read these algorithms and now understand how the game will be solved. But when i sat to down to code, I am facing problem how to approach it. As in , How to design the prototype functions like getNextMove or Max(Move) ? How will the next move searched? Till when should i apply the minimax algorithm. I know i can find the code online, but i want to do it myself. Can anyone please point me in the right direction?

    Read the article

1 2  | Next Page >