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)

1
vote
0answers
31 views

Ensuring submitted hiscores are not fake

I have a small game that I would like to keep track og global hiscores for. The basic is simple: username and score is submitted to a server for storage and later polling. However how do I ensure that ...
0
votes
0answers
17 views

Trying to write my own algorithm for the Fibonacci Sequence [on hold]

So I am 15 and love Computer Science and programming. I understand that Computer Science involves a lot of algorithmic programming, and would like to get in to this, rather than UI and application ...
0
votes
0answers
11 views

Algorithms in MapReduce [on hold]

I have been learning MapReduce for recent times, The problem I'm having is I still don't know how to design different algorithms(such as graph algorithms, searching, parsing, ...) in MapReduce? Is ...
0
votes
1answer
61 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
24 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, ...
-3
votes
0answers
26 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
38 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
63 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 ...
0
votes
1answer
51 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
85 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 ...
3
votes
1answer
88 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 ...
-2
votes
0answers
49 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 ...
4
votes
3answers
479 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 ...
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 ...
-4
votes
0answers
64 views

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

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 ...
0
votes
1answer
82 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 ...
8
votes
1answer
116 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 ...
-2
votes
0answers
31 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 ...
-1
votes
0answers
31 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
62 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 ...
3
votes
1answer
209 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 ...
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 ...
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
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 ...
-1
votes
1answer
68 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 - ...
10
votes
5answers
696 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. ...
-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
168 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 ...
3
votes
2answers
63 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
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
79 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 ...
1
vote
0answers
101 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
1answer
118 views

problem on calculating Big O complexity

i have this function on which i have to calculate the time complexity with the Big O notation: public void print(ArrayList<String> operations, ArrayList<LinkedHashSet<String>> ...
-1
votes
0answers
33 views

Preference Matching Algorithm [migrated]

There's this side project I'm working on where I need to structure a solution to the following problem. I have two groups of people (clients). Group "A" intends to buy and group "B" intends to sell a ...
2
votes
1answer
64 views

Random forest ML algorithm suitable for use on cluster based HPC?

I need help in identifying a better algorithm. I have developed a script using pythons scipy package to analyse a rather large model that I wish to solve. The model contains over 12GB of data ...
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 ...
1
vote
2answers
56 views

Adding a minimum rectangle overlap threshold

I have a function that works perfectly for detecting whether or not r1 overlaps with r2: boolean overlaps( Rectangle r1, Rectangle r2 ) { return r1.x < r2.x + r2.width && r1.x + ...
0
votes
0answers
35 views

How do I prove theta(log n)=o(log n)? [migrated]

I'm solving a question from CLRS where we need to prove that (ceil(lg lg n))! is polynomially bounded. Let g(n)=(ceil(lg lg n))! lg(g(n))=lg((ceil(lg lg n))!) =theta(ceil(lg lg n) * lg ...
0
votes
1answer
29 views

Matching weighted unbalanced Bipartite graph

I am looking for a way to solve an assignment problem, but I am having some problems finding the correct algorithm to use. I have 2 list of nodes A and B, and in my problem may the length of A not be ...
0
votes
1answer
46 views

How to create a scoring system with time and correct answers for a game?

o create a scoring system with time and correct answers for a game? up vote 0 down vote favorite I have a small mobile quiz game, which consists of 30 questions, and a timer which starts from 0 ...
1
vote
3answers
66 views

Algorithm to reduce calls to mapping API

A random distribution of points lies on a map. This data lies behind an API, and I want to grab the complete set of points within a given bounding box. I can query the API with the bounding box and ...
1
vote
3answers
67 views

Count unique visitors by group of visited places

I'm facing the problem of counting the unique visitors of groups of places. Here is the situation: I have visitors that can visit places. For example, that can be internet users visiting web pages, ...
1
vote
0answers
53 views

Can TDD help me develop a CUDA version of image/video processing algorithms? [closed]

I have tried many ways to migrate the image/video processing algorithm I have to run on GPU using CUDA framework and made a little progress. From reading around Stack Overflow I found a lot of ...
0
votes
1answer
237 views

Algorithm to Copy data faster than windows default copy provider

I need an algorithm which can copy data(files/folder) from one place to another, faster than windows default copy/paste option. I'm working in vc++. Is there any algorithm by which I can do copy/paste ...
0
votes
1answer
38 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 ...
0
votes
1answer
58 views

Algorithm to measure how “diffused” 5,000 pennies are in an economy?

Please allow me to use this example/metaphor to describe an algorithm I need. Objects There are 5 thousand pennies. There are 50 cups. There is a tracking history (Passport "stamp" etc) that is ...
3
votes
4answers
220 views

Indefinite loops where the first time is different

This isn't a serious problem or anything someone has asked me to do, just a seemingly simple thing that I came up with as a mental exercise but has stumped me and which I feel that I should know the ...
0
votes
0answers
206 views

Multidimensional multiple-choice knapsack problem: find a feasible solution

My assignment is to use local search heuristics to solve the Multidimensional multiple-choice knapsack problem, but to do so I first need to find a feasible solution to start with. Here is an example ...
-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 ...