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.

learn more… | top users | synonyms (1)

0
votes
1answer
41 views

Decrease probability of picking a list's item based on its index

I have a list of sounds that are to be played when the user presses a button. For now I just generate a random number within the range of the list and just pick the sound with that index. (I also ...
0
votes
1answer
14 views

Traverse a matrix using a linear index to get an evenly distributed values sample

I'm looking for an algorithm idea on how to traverse a matrix using a linear index while avoiding row/column based traversals to get a more diverse distribution of values. To understand this better, ...
0
votes
1answer
37 views

How can I rank teams based off of head to head wins/losses

I'm trying to write an algorithm (specifically in Ruby) that will rank teams based on their record against each other. If a team A and team B have won the same amount of games against each other, then ...
-3
votes
0answers
25 views

Recommendation Algorithm Engine [on hold]

I would like to understand how something like Amazon's "recommendation" engine works? I have a need to do something similar. Any idea on places to start learning about this?
-2
votes
0answers
35 views

a card game of k rounds (0segment tree) [on hold]

I have n cards each has a number.I have n player. now in each round 2 cards x and y are selected and a game is played between the owner of the cards.initially i th player is owner of ith card.if ...
0
votes
0answers
61 views

GSP Algorithm explanation

I've been trying to implement the GSC algorithm in C++, however I need help with clarifying the definition: http://en.wikipedia.org/wiki/GSP_Algorithm GSP Algorithm makes multiple database ...
51
votes
9answers
11k views

I'm a CS student, and honestly, I don't understand Knuth's books [on hold]

I stumbled upon this quote from Bill Gates: "You should definitely send me a resume if you can read the whole thing." He was talking about The Art of Programming books. So I was pretty curious and ...
3
votes
1answer
85 views

Identify algorithm for my resource allocation needs

I'm trying to automate a task and I lack the right vocabulary to look up the correct algorithm. It really feels like a common problem that has likely been solved many times before. All I'm looking ...
0
votes
1answer
50 views

Weight based mapping algorithm

I am writing automatic assignment of tasks to the users. Every user has a weight (integer) and tasks should be distributed to the users according to their weights. For example I have 10 tasks and User ...
-1
votes
3answers
84 views

Given known inputs and outputs, can we generate candidate functions that will map the inputs to outputs?

I've run into a problem where I have a set of inputs, as well as a couple known input-output pairs. I am interested in the output, but in order to get that, I need to figure out how the input is used ...
0
votes
1answer
70 views

Even distribution through a chain of resources

I'm working on an algorithm which routes tasks through a chain of distributed resources based on a hash (or random number). For example, say you have 10 gateways into a service which distribute tasks ...
4
votes
3answers
475 views

What is a helper? Is it a design pattern? Is it an algorithm? [on hold]

Maybe a little tongue-in-cheek, but as I can't find this answer anywhere through Google, so to ensure Programmers Stackexchange has the answer: What is a helper? I see the name being used everywhere ...
-2
votes
0answers
44 views

Python code to find unique combinations of factors of a number [on hold]

I have the below code which prints the unique combination of factors of a given number. But I does not give the desired output. The code is a s follows: #Print the factors list for the given number ...
1
vote
1answer
34 views

Equidistant polygons

Consider these polygons: For reasons of simplicity I only consider triangles or polygons with 4 vertices. These shapes are specified by the vertices, the output of the program should be modified ...
0
votes
1answer
60 views

How can I approach creating an efficient algorithm for maximizing value with these specific constraints?

I'm having trouble coming up with an approach that isn't n^2 for this problem. Here's a contrived, simplified version I've come up with: Let's say you're a company that needs 4 employees to launch in ...
28
votes
11answers
3k views

Random number generation algorithm for human brains? [closed]

Are you aware of, or have you devised, any practical, simple-to-learn "in-head" algorithms that let humans generate (somewhat "true") random numbers? By "in-head" I mean.. preferably without any ...
5
votes
6answers
724 views

How meaningful is the Big-O time complexity of an algorithm?

Programmers often talk about the time complexity of an algorithm, e.g. O(log n) or O(n^2). Time complexity classifications are made as the input size goes to infinity, but ironically infinite input ...
32
votes
13answers
3k views

Unit-testing of inherently random/non-deterministic algorithms

My current project, succinctly, involves the creation of "constrainably-random events". I'm basically generating a schedule of inspections. Some of them are based on strict schedule constraints; you ...
24
votes
6answers
12k views

Can an algorithm be patented?

So can an algorithm be patented? I saw this statement which made me think: Everybody would abstain from patenting the improvements of contour dot algorithm for at least several years, say ...
0
votes
0answers
31 views

Can sequence alignment algorithms be used for search implementation?

Hi I want to implement a search on a website which includes imperfect search results. Meaning, if the search term is misspelled or slightly different from a 100% match, the function should still ...
1
vote
2answers
112 views

Reduce a list of IPv4 to lowest common CIDR

I have a long list of IP addresses that show some pattern of closeness Example: XX.249.91.16 XX.249.91.21 XX.249.91.32 XX.249.91.160 XX.249.91.165 XX.249.92.15 XX.249.92.25 ...
0
votes
1answer
80 views

Calculate reachability of one point from another

I have an array which stores a set of positive x coordinates in sorted way, say arr={1, 4, 5, 9, 12, 45} etc. And I have a maximum distance k which I can go from one point to another point let ...
0
votes
1answer
144 views

Compress range of numbers into blocks of used or unused

Given a numerical range and a list of used numbers that fall within that range I need to compress the range into blocks of used and unused numbers. For example: range: 0 to 10 used: 3,4,5,9 I ...
-4
votes
0answers
64 views

Do all programs have inputs that are externally provided (by the user)? [on hold]

For me, this is not true for all programs because there are some programs whose values are already given by the programmer. Also, do we use reserved words in pseudocode? I believe that the answer ...
8
votes
1answer
115 views

An algorithm for reconstructing a graph from its shortest path information?

I have some shortest path data for a graph. Can I reconstruct the graph itself from this data? More precisely, I have a boolean (0/1) matrix for each vertex v in graph (V, E). Matrix element [s,d] is ...
-1
votes
1answer
111 views

How to solve linear recurrences involving two functions?

Actually I came across a question in Dynamic Programming where we need to find the number of ways to tile a 2 X N area with tiles of given dimensions.. Here is the problem statement Now after a bit ...
0
votes
1answer
179 views

Find possible variations of one item out of multiple baskets.

I have three baskets of balls and each of them has 10 balls which have the following numbers: Basket 1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Basket 2: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ...
-2
votes
0answers
29 views

find number of cycle in a permutation [closed]

I have given a permutation let 2 3 1 5 4 that is if initially my string is 1 2 3 4 5 the after one permutation it will become 1 2 3 4 5 3 1 2 5 4 that is the number in first position will go to 2 ...
3
votes
2answers
353 views

NLP - Queries using semantic wildcards in full text searching, maybe with Lucene?

Let's say I have a big corpus (for example in english or an arbitrary language), and I want to perform some semantic search on it. For example I have the query: "Be careful: [art] armada of [sg] is ...
-1
votes
0answers
30 views

What are some of the efficient ways to test your algorithms ? [duplicate]

I have just started with competitive programming and must tell you that, I don't have a lot of experience with solving these type of problems. As a result , I started by solving the easiest problems ...
3
votes
1answer
61 views

Does parallel mergesort run differently on mesh vs linear array of processors?

I'm currently taking course on introduction to algorithm and I came across the parallel mergesort algorithm. My question is: Is there any differences in the algorithm plan if it runs on a 2d mesh ...
0
votes
1answer
47 views

An algorithm for finding converse duplicates of ordered pairs

Given an array of ordered pairs of values, is there a well-known algorithm to find converse duplicates? [Converse meaning the same values, but in the opposite order.] That is, given ...
9
votes
2answers
532 views

longest list of words with matching start and end letters

My friend gave me a problem that he says is easy, but I can't figure out a good algorithm to use to do it. You are given an input of 100 random English words. You have to find the longest string of ...
3
votes
1answer
208 views

Which algorithms do I need to look into?

First things first: I need to apologize in advance about the bad choice of title for this question, but I really couldn't come up with something meaningful. I'm actually looking for suggestions as to ...
2
votes
0answers
25 views

Find the smallest summed distances by uniquely pairing elements of one set to elements of another set [migrated]

As input I have two sets of points in RN, typically for large N, for example N=40. Supose both sets have m elements: S = s1 ... sm T = t1 ... tm Semantically both sets are equal, but due to noise ...
1
vote
1answer
60 views

Efficient algorithm for Virtual Machine(VM) Consolidation in Cloud

PROBLEM: We have N physical machines(PMs) each with ram Ri, cpu Ci and a set of currently scheduled VMs each with ram requirement ri and ci respectively Moving(Migrating) any VM from one PM to ...
1
vote
1answer
85 views

Taxonomy / Classification of real world objects. Development suggestions [closed]

I have to develop a taxonomy/classification program based on classification algorithms and i would like to have some suggestions. The aim is to help the one using the program to categorize an object ...
0
votes
1answer
42 views

Algorithm to match timestamped events from two sources

I have two different physical devices (one is camera, one is other device) that observe the same scene and mark when a specified event occures. (record timestamp) So they each produce a serie of ...
10
votes
5answers
691 views

Algorithm for percentage without knowing total number

Suppose there are n lines for a hotline. Whenever a customer calls the hotline, the call is forwarded to one of the n lines. And I want to assign percentage of calling to each of the n lines. ...
0
votes
1answer
80 views

What algorithms would suit image colour summarization?

I would like to analyse a set of hundreds of thousands of product images (clothing, electronic goods etc) and retrieve the dominant colours in each. I'm only interested in the top 3 or 4 colours. The ...
3
votes
2answers
62 views

Trivially Sortable Encoding for Arbitrary-Precision Decimals

I'm looking for a reasonably(*) space-efficient way to encode arbitrary-precision decimals (e.g. BigDecimal), such that when sorting the bit-pattern of the encodings lexicographically, the numbers ...
0
votes
1answer
65 views

get all the combination of a given set of numbers [duplicate]

I m trying to get the possible combinations of a given set of numbers say for example 123 The possible combinations would be 123 132 213 231 312 321 For this i have written a code as below - ...
3
votes
1answer
146 views

Minimize travel distance of n people to n locations

The problem: Given the coordinates of N people on a regular 2-dimensional plane and N target points-of-interest (POI) on the same plane, determine the set of pairs of people and POIs that minimize ...
-2
votes
0answers
71 views

How can I improve the following code in terms of faster execution? [migrated]

The problem is described here - Aaah!. My source code for the problem is below. I one of the fast running codes, but not the best. What changes can I make so as to improve the efficiency of the code. ...
0
votes
1answer
166 views

Is Microsoft Solver capable of solving such complex scheduling problems

I'm writing a application that will decide the scheduling plan for a few dozen people according to their occupation (role) and availability (week day and hours). I've used a excel spreadsheet to help ...
2
votes
4answers
322 views

Is there any sorting algorithm which is not inherently sequential and is task distributable?

After googling for a couple hours, I came to a conclusion that all sorting algorithms are inherently sequential which can be data distributed but not task distributable. Is there any algorithm which ...
1
vote
0answers
100 views

Algorithmic approach for text analysis of ingredients and instructions [closed]

Background Looking to separate lists of ingredients from instructions. Users scan recipes from 3x5 cards, magazines, cookbooks, etc. OCR software converts scanned images into plain text--typically a ...
0
votes
3answers
214 views

Application qos involving priority and bandwidth

Our manager wants us to do applicaiton qos which is quite different from the well-known system qos. We have many services of three types, they have priorites, the manager wants to suspend low priority ...
0
votes
0answers
39 views

Generating all the words accepted by a deterministic finite automaton [duplicate]

Imagine you've got a finite deterministic automaton A defining some finite regular language L, consisting of N words. The first question is: how would you determine the number of words N? Then, I ...
3
votes
1answer
78 views

Defining a random “safe” path for a game character

I am writing a game in Java and it can be likened to the recently popular game "Flappy Bird" in the sense that the character moves up and down and the users touch and must avoid the obstacles. The ...