heuristics

Heuristic algorithm for load balancing among threads.

I'm working on a multi-threaded program where I have a number of worker threads performing tasks of unequal length. I want to load-balance the tasks to ensure that they do roughly the same amount of work. For each task Ti I have a number ci which provides a good approximation to the amount of work that is required for that task. ...

Finding minimum cut-sets between bounded subgraphs

If a game map is partitioned into subgraphs, how to minimize edges between subgraphs? I have a problem, Im trying to make A* searches through a grid based game like pacman or sokoban, but i need to find "enclosures". What do i mean by enclosures? subgraphs with as few cut edges as possible given a maximum size and minimum size for numbe...

Guessing the time zone from an arbitrary "location" string?

I'm trying to run some statistics over the Stack Overflow data dump, and for that I would like to know the time zone for each user. However, all I have to go on is the completely free-form "location" string. I'll stress that I'm only looking for an approximation of the time zone; of course, in general this is an unsolvable problem. Howe...

Thread management advice - Is TPL a good idea?

I'm hoping to get some advice on the use of thread managment and hopefully the task parallel library, because I'm not sure I've been going down the correct route. Probably best is that I give an outline of what I'm trying to do. Given a Problem I need to generate a Solution using a heuristic based algorithm. I start of by calculating a ...

Deterministic Annealing Code

I would like to find an open source example of a code for deterministic annealing. It can be in almost any language: C, C++, MatLab/Octave, Fortran. I have already found a MatLab code for simulated annealing, so MatLab would be best. Here is a paper that describes the algorithm. Deterministic annealing is an optimization technique ...

Given a document, select a relevant snippet.

When I ask a question here, the tool tips for the question returned by the auto search given the first little bit of the question, but a decent percentage of them don't give any text that is any more useful for understanding the question than the title. Does anyone have an idea about how to make a filter to trim out useless bits of a que...

Number of simple mutations to change one string to another?

Hi; I'm sure you've all heard of the "Word game", where you try to change one word to another by changing one letter at a time, and only going through valid English words. I'm trying to implement an A* Algorithm to solve it (just to flesh out my understanding of A*) and one of the things that is needed is a minimum-distance heuristic. ...

Is there anything for Python that is like readability.js?

Hi, I'm looking for a package / module / function etc. that is approximately the Python equivalent of Arc90's readability.js http://lab.arc90.com/experiments/readability http://lab.arc90.com/experiments/readability/js/readability.js so that I can give it some input.html and the result is cleaned up version of that html page's "main t...

Balancing heuristics (for timetable problem)

I'm writing a genetic algorithm for generating timetables. At the moment I'm using these two heuristics: Number of holes between lectures in one day (related) (less holes -> bigger score) Each hour has some value, so for each timetable I sum values for hours when lectures are on. (lectures at more appropriate hours -> bigger score)...

Splitting a set of object into several subsets according to certain evaluation

Suppose I have a set of objects, S. There is an algorithm f that, given a set S builds certain data structure D on it: f(S) = D. If S is large and/or contains vastly different objects, D becomes large, to the point of being unusable (i.e. not fitting in allotted memory). To overcome this, I split S into several non-intersecting subset...

Where are strings more useful than a StringBuilder?

Lot of questions has been already asked about the differences between string and string builder and most of the people suggest that string builder is faster than string. I am curious to know if string builder is too good so why string is there? Moreover, can some body give me an example where string will be more usefull than string build...

Approximate Estimation of Distance Matrices

I have a set of N objects, and I'd like to compute a NxN distance matrix. Sometimes my set of N objects is very large, and I'd like to compute an approximation to the NxN distance matrix by only computing a subset of the distance comparisons. Can anyone point me in the direction of something that calculates approximations to a full dis...

Are there any CSS padding heuristics that I can follow?

I have a simple problem: I have an image inside of a div. In order to make the page more aesthetically pleasing, I'm going to add some additional padding to the image. Rather than eyeball it, I'd like to know: Are there any CSS padding heuristics that I can follow? I was thinking that somebody of Jakob Nielsen's caliber might h...

Find set of numbers in one collection that adds up to a number in another.

For a game I'm making I have a situation where I have a list of numbers say [7, 4, 9, 1, 15, 2] (named A for this) and another list of numbers say [11, 18, 14, 8, 3] (named B) provided to me. The goal is to find all combinations of numbers in A that add up to a number in B. For example: 1 + 2 = 3 1 + 7 = 8 2 + 9 = 11 4 + 7 = 11 1...

Previous/Next Web Page Links Heuristics?

I'm looking for a list of heuristics, given an HTML document and/or a set of URLs on a web page, that will give a set of URLs that are previous/next links from that page. Also, assume that you are given the base URL. I do not require to know if a link is specifically a next or previous URL, just that it is one of those two. I've got a...

Determine if a URL is in the header/footer of a web page given URL, page DOM, parent URL and other page URLs.

Given a URL, the URL of the webpage that first URL is on, the DOM of the webpage, and a list of the rest of the URLs on the webpage how can I reliably determine if the URL is in the header/footer of the page or if it's in neither? I'm using C#/.NET. I know that no solution is perfect since webpages are not semantically expressed and al...

N-Puzzle with 5x5 grid, theory question

I'm writing a program which solves a 24-puzzle (5x5 grid) using two heuristic. The first uses how many blocks the incorrect place and the second uses the Manhattan distance between the blocks current place and desired place. I have different functions in the program which use each heuristic with an A* and a greedy search and compares th...

What's a good set of heuristics for threading tweets?

Everyone knows, if you want to thread emails you use Jamie Zawinski's alogirhtm. But it's a new century, and there's a new messaging service. What's the best algorithm for threading status updates posted on twitter? Things I'd definitely like it to cope with: Understanding in_reply_to_status_id Understanding in_reply_to_user_id, and ...

Are there any open source Hierarchical Temporal Memory libraries?

I'm potentitally interested in the using Hierarchical temporal memory heuristic to solve a research problem I am working on. Some more details about it can be found here: http://en.wikipedia.org/wiki/Hierarchical_temporal_memory Are there any open source libraries for this? (I'm fairly open to languages although c++, java or haskell is ...

Algorithm: Determining type of homepage?

I've been thinking about this for a while now, so I thought I would ask for suggestions: I have some crawler which enters the root of some site (could be anything from www.StackOverFlow.com, www.SomeDudesPersonalSite.se or even www.Facebook.com). Then I need to determin what "kind of homepage" I'm visiting.. Different types could for in...