# Tagged Questions

In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning.

18 views

I need to find an optimal distribution of some matching tasks on multiple jobs; each job is limited by a maximum workload and the grouped tasks should maximize the workload within the same job. ...
37 views

### Algorithm for seating Zoombinis on Captain Cajun's ferryboat?

I've been playing the rerelease of The Logical Journey of the Zoombinis recently, and trying to implement some computer algorithms that can solve the various puzzles. I'm stuck on how to approach the ...
104 views

### What algorithm or program does Java use for arithmetic?

I was looking at bitwise ways to multiply and add numbers without using * or + operators. But I want to know that it might be possible that java may already be using a better approach underneath. I ...
60 views

### How can I filter my coordinates system?

Following up with this, I have a bunch of coordinates and I draw them on a bitmap image as a coordinate system. Now, I would like to get rid of all the noise, and filter coordinates to give a "clearer"...
30 views

### Need a solution for data filter problem

Problem statement: I have a input with multiple key value pairs and a list tasks stored in database with filter object. As an output I need a list of tasks matching the input values based on task's ...
304 views

### Efficient way to calculate how many items to destroy if each has a 70% chance to be destroyed

We start with a variable that holds an integer for the "number of items" that we have somewhere, somehow. Then, the algorithm is applied: each one of those items have a 70% chance to be destroyed. ...
67 views

### Getting a stateless time-based index out of overflowing timer

I'm currently working on an Arduino project where I need to keep track of entries for a certain amount of time, in this case, 30 days. Our company will attempt to sell this product to cities and ...
70 views

### Algorithm for lines comparison

I'm working on the import of land-use data into Openstreetmap. Unfortunately I've encountered a problem that has delayed my time table. Take a look at the picture below: the red line is the main road ...
96 views

### Split k sets to 2 groups of sets

Given k sets ,each contain several elements . I want to split them to two groups , the first group contains m sets ,the second group contain n sets , m + n = k . Let w1 be the sum of the weights of ...
36 views

### Extract All Possible Paths from Expression-Tree and evaluate them to hold TRUE

This is a follow-up question of my previous one: http://stackoverflow.com/questions/38421950/better-class-structure-for-logical-expression-parsing-and-evaluation Brief introduction: rules as ...
121 views

### Decomposing into multiple of divisors

I have a number x. I know its prime factors and their multiplicity. Does anyone know an algorithm that decomposes it into all possible combination of its divisors (without respect to order)? E.g. x=...
161 views

### Algorithm for ranking a list of items

Given a list of items, what's the most efficient way of ranking those items with the least number of comparisons? Is there a name for this type of algorithm (that way I can focus my search)? Also, is ...
46 views

### How to shift elements within a matrix?

I have a grid of objects that occupy cells in a grid. Basically similar to android launcher - with icons and widgets and whatnot, because that's what I am building. To keep track of which cells are ...
273 views

### Recursion in Merge Sort algorithm. How is it obvious to use this type of recursion?

I dont want to put too much code so I'll just put the code that involves recursion. This algorithm is fairly well known so I think everybody knows the basic code. void mergeSort(int array[], int l, ...
100 views

### Place circle such that it overlaps the most possible other circles

Given a list of circles (each with parameters (x,y,radius) ) I want to place another circle with a fixed radius such that it overlaps the maximum possible circles from the list of circles. As long ...
39 views

### How to get the average of how many occurrences of numbers [closed]

I have code that looks at numbers 1 - 5, and counts how many occurrences of those numbers appear in an algorithm. What is an algorithm for finding the average number of 1 - 5 by counting the ...
33 views

### Finding and counting equal substrings in a set of strings

I'm thinking about a way of finding similar parts in Strings. I have a set of strings of variing length i.e: The quick brown fox jumps fox force five the bunny is much quicker than the fox is ...
278 views

### How to solve this seating problem?

I was solving a seating problem whose solution seems trivial but I am not able to get it. The problem states in short that we have to seat n (even) students in n/2 rows where students are labelled ...
36 views

### Sort numbers into three groups s.t. their sums are close to a certain value

I have a list of numbers (let's call it L) and I need to split this list into three groups (A, B, and C) such that the sum of the numbers in each group (sum(A), sum(B), sum(C)) is as close as possible ...
42 views

### All minimum cuts in flow network [migrated]

I'm trying to prove that for a flow network, maximum flow f, and each minimum cut S that f(S)=c(S). Max flow min cut promises that there exists a cut where f(S)=c(S); I want to prove that given ...
328 views

### Fast, lossless compression of a video stream

I have a video coming from a stationary camera. Both the resolution and the FPS are quite high. The data I get is in Bayer format and uses 10 bit per pixel. As there's no 10 bit data type on my ...
124 views

### How to use the 0-1 knapsack problem with more than one bag

The 0-1 knapsack is a well-known algorithm that solves the problem of finding the maximum profit P of putting some of n object( each of weight w and profit p) in a bag of capacity W. How can I use ...
63 views

### Pitch/Time Shifting of a PCM byte array

I am searching for a universal algorithm that shifts pitch and time while keeping the sample rate. (I am trying to program a sound generator (sine, triangle...) as an exercise) I just want to squeeze ...
70 views

### high-dimensional index structures

I'm looking for information on searching (filtering) high-dimensional data. I'm not interested in nearest-neighbour search or clustering, but rather filtering/sorting by subset of dimensions - like in ...
100 views

### How to detect someone tweets using twitter API?

I am learning API. I now want to write a program to send an email once some twitter users tweet. I have found there is an API call (user_timeline) which can get the tweets from an user. So my idea ...
104 views

### Algorithm to satisfy given constraints - assigning values from a 2D array

So me and my friend came up with a rather interesting (maybe?) algorithm question but ironically, we are having a hard time solving it. The question goes like this: There is a sale of precious stones ...
38 views

### What would be an appropriate algorithm to solve mixed data range problems

Generally what kind of algorithm is used to solve when dealing with overlapping data sets . In the below problem set, we can see that region (point 2 to point 3) is common to both statement A and ...
37 views

### Find longest match from a set of possibles, given a string

I’m implementing glossary/dictionary in Javascript. It is populated with a set of terms and their definitions internally, then gets handed jQuery elements and searches the HTML, replacing any of the ...
132 views

### Formalising algorithms - Greek symbol uses/sources [closed]

I am looking to formalise an algorithm that I have created, however, I am having trouble knowing how to correctly use Greek symbols (such as Epsilon, Omega etc.). Are there any guides/standardised way ...
105 views

### How to compare two objects for percentage of equivalence

I'm trying to create a nodeJS application. It allows users to rate a bunch of songs and it stores them in their user profiles. I use this information to compare them to other users, and try to find ...
168 views

### Euler's sum of powers conjecture. How to efficiently search counterexamples?

I tried to repeat this results: 27^5 + 84^5 + 110^5 + 133^5 = 144^5 (Lander & Parkin, 1966) and 95800^4 + 217519^4 + 414560^4 = 422481^4 (Roger Frye, 1988, 110 hours this is the only ...
33 views

### What are the methods to accurately test the accuracy of a parts of speech tagger?

I know that most of the pos tagger algorithms measure their accuracy token wise I.e. whether the token is tagged correctly or not Some pos taggers provide sentence accuracy too. How is sentence ...
58 views

### Choose “representative” subset out of a set of points

So I have a set of given locations (i.e. two-dimensional points) G, a set of wanted locations W and a natural number N. Assume |W| < N. I want to choose N elements of G such that the elements of ...
131 views

### Given an array of number, how to calculate to a target value

Chatting with a friend about a game we used to play, and thinking how to implement it in code. Here are the rules: Given a list of number e.g. {1,2,3,4} Try to use all the numbers from the list to ...
54 views

### Converting dynamic webpage into static

I am working on a project in which I need to take a dynamic website like adobe spark - https://spark.adobe.com/gallery/gallery-editors-choice/example/maggie-to-monte/ and create a static html+css page ...
177 views

### Potential legal issues with lock-free / wait-free structures / algorithms

While researching the subject matter - lock-free and wait-free data structures - I'm seeing a worrying amount of mention of patents with this area. I've hobby-researched compression algorithms years ...
63 views

### Dynamic-programming matrix exercise

I'm practicing with dynamic programming and I'm trying to solve this exercise http://www.geeksforgeeks.org/collect-maximum-points-in-a-grid-using-two-traversals/ But I can't understand how to use ...
53 views

### String Pattern Matching from Lookup Table - Non-Exponential Solution?

Given the problem... Given a String comprising of non-alhpabetical symbols, and a Lookup Table where a subset of those symbols may equate to a single alphabetical character, output all ...
46 views

### Algorithm: Calculate average time in given time frame

I have a complex problem to solve. Problem Statement: I have a list of cities: Lets say New York, LA Las Vegas California The list of cities is limited, not more than 10. Now there are peoples ...
22 views

### Consistent hash ring with subsets in different buckets

I have N buckets. I have M users. Each user can buy anywhere between 1 and N tickets to an upcoming lottery. I would like to distribute the tickets more or less evenly between the buckets, with the ...
73 views

### How does Pearson hashing compare with other non-cryptographic hashing algorithms?

FNV-1, Murmur2, and DJB2 are examples of non-cryptographic hashing functions used in actual applications (see Which hashing algorithm is best for uniqueness and speed?). These are all similar in that ...
32 views

### efficient graph clustering algorithm for weighted directed graphs based on node and edge weights

I'm looking for an algorithm to cluster weighted directed graphs that have weights on both edges and vertices. I'm using graphs with multiple weights(labels) on vertices and a weight on edges that ...
47 views

### Hash system to generate same (specified) hash from multiple datasets?

I have a hashed value X and need to ensure that any of the data sets D1...Dn can be concatenated with a correctional value C1...Cn and passed into a hashing algorithm to result in the value of X. ...
102 views

### Most efficient algorithm for getting the word frequencies in a stream of characters?

I have a dictionary of words and a stream of incoming characters. I need to create a map of words present in the stream along with their frequencies. How can I achieve this efficiently?
117 views

### How to find suppliers who can supply to me?

I am not able to search for algorithms which can help me solve this problem, I am not sure under which category this problem falls or which algorithm to use. Problem statement: There are N number of ...
95 views

### How do I implement autocomplete functionality for a big website? [closed]

I am looking to implement a custom autocomplete functionality for a travel website with huge amounts of data. I am thinking of implementing it using a trie. But how do I handle it if the data cannot ...
65 views

### Complex Math Formula: Predict the value of variable if result is known

I have a very complex math formula/equation which involves exponential. Formula: X + 2 = Y *PS: The above is just an example to illustrate my problem. The real formula is way more complex than this....
84 views

### How to implement to flood fill algorithm on multiple machines?

I have a large image distributed over multiple machines for which I need to implement the flood fill algorithm used in MS Paint. I am able to do it with a single machine but what approach must be ...