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
43 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
87 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
70 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 ...
2
votes
3answers
170 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, ...
0
votes
1answer
316 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
179 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
63 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
248 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
405 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
130 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 ...
3
votes
2answers
188 views

Find points whose pairwise distances approximate a given distance matrix

Problem. I have a symmetric distance matrix with entries between zero and one, like this one: D = ( 0.0 0.4 0.0 0.5 ) ( 0.4 0.0 0.2 1.0 ) ( 0.0 0.2 0.0 0.7 ) ( 0.5 1.0 0.7 0.0 ) I would ...
0
votes
3answers
196 views

Tournament bracket method to put distance between teammates

I am using a proper binary tree to simulate a tournament bracket. It's preferred any competitors in the bracket that are teammates don't meet each other until the later rounds. What is an efficient ...
1
vote
2answers
43 views

Minimizing Average Pairwise Squared Euclidean Norm

I'm pretty new to programming and computer science, but I was wondering if there was any good way to approach the following problem: For a set of 2n points (not necessarily unique) in R^k (assume each ...
4
votes
1answer
97 views

Tail-recursive implementation of take-while

I am trying to write a tail-recursive implementation of the function take-while in Scheme (but this exercise can be done in another language as well). My first attempt was (define (take-while p xs) ...
2
votes
1answer
133 views

How to canonise a road network

I am working on geographical data which represents the road network of some city and I need to automatically fix inaccuracies in the data. Data was manually produced by “drawing” the road network ...
3
votes
1answer
135 views

How to avoid oscillation by async event based systems?

Imagine a system where there are data sources which need to be kept in sync. A simple example is model - view data binding by MVC. Now I intend to describe these kind of systems with data sources and ...
0
votes
2answers
67 views

Algorithm for optimal combination of two variables

I'm looking for an algorithm that would be able to determine the optimal combination of two variables, but I'm not sure where to start looking. For example, if I have 10,000 rows in a database and ...
1
vote
1answer
114 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 ...
0
votes
2answers
128 views

High-level strategy for distinguishing a regular string from invalid JSON (ie. JSON-like string detection)

Disclaimer On Absence of Code: I have no code to post because I haven't started writing; was looking for more theoretical guidance as I doubt I'll have trouble coding it but am pretty befuddled on ...
1
vote
2answers
212 views

Efficient algorithm to find a the set of numbers in a range

If I have an array of sorted numbers and every object is one of the numbers or multiplication. For example if the sorted array is [1, 2, 7] then the set is {1, 2, 7, 1*2, 1*7, 2*7, 1*2*7}. As you can ...
2
votes
1answer
116 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 ...
7
votes
5answers
560 views

Algorithm for flattening overlapping ranges

I am looking for a nice way of flattening (splitting) a list of potentially-overlapping numeric ranges. The problem is very similar to that of this question: Fastest way to split overlapping date ...
1
vote
1answer
98 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 ...
0
votes
1answer
184 views

Algorithm for detecting windows in a room

I am dealing with the following problem and i was looking to write a Pseudo-code for developing an algorithm that can be generic for such a problem. Here is what i have come up with thus far. ...
3
votes
1answer
179 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 ...
1
vote
2answers
179 views

How to construct a cubie representation of a rubik's cube, given an array

Just to get this out of the way, I have seen this, and it is not what I'm looking for. So, let's say you are programming a Rubik's Cube. (I know, very unoriginal, but bored programmers have to do ...
4
votes
1answer
202 views

Does anybody recognize this scheduling problem? Is there an algorithm for it?

Consider the following problem: Description: There are n jobs J1...Jn with cycle times C1....Cn. Find a time quanta and a scheduling table considering that: any element of the table contains at ...
0
votes
2answers
393 views

Exercise 3.6: Skiena Algorithm Design Manual

I am preparing for interview and try to solve the exercise problems of the book. 3-6. [5] Describe how to modify any balanced tree data structure such that search, insert, delete, minimum, and ...
0
votes
1answer
70 views

Algorithmic Forecasting and Pattern Recognition

Say a user could enter project data into my software. Each project has 2 variables "size" and "work" and they're related but the relationship is not known. Is there a way to programmatically determine ...
0
votes
1answer
34 views

What would be the most efficient way to reduce the complexity of a set of rotations to a cube?

Despite the long title, my question is fairly simple. Let's say you have a cube in 3D-space and you want to rotate it along the three axes based on the set of instructions provided by a user or ...
2
votes
1answer
1k views

Why is time complexity of k-way merge sort O(nk^2)?

I'm comparatively new to algorithm analysis and am taking a related course on coursera where I came accross k way merge sort. The time complexity of 2 way merge sort is n log2 n, of 3 way merge sort ...
10
votes
2answers
2k views

What is the relationship between data structures and algorithms? [closed]

I have been searching for a good online course in data structures but have found that Google also returns results for algorithms courses, which say stuff like: In this course you will learn ...
0
votes
0answers
62 views

Search substring using suffix array (and LCP)

I'm searching for a best way to improve suffix array run time using LCP. My text (about 2 500 000 chars) seems like: 0ricco0eric0america0polo0.... My thoughs: SA=suffixArray char=firstChar(input) s ...
1
vote
2answers
32 views

Fixed duration Jobs need to be scheduled across fixed number of queues

Say I have 9 jobs with estimates of how long they will take to complete, and 3 queues that process these jobs - this constitutes one batch. Note that all the jobs are allocated to a queue beforehand ...
2
votes
2answers
453 views

Find number of occurrence of a word in a 2D matrix of Characters

Given a two dimensional matrix of alphabets, search the given word in all directions. Below is an example to search for the word "TEAM": No of occurrences is 4 in matrix below. What is the best ...
4
votes
1answer
324 views

Writing a spell checker similar to “did you mean”

I'm hoping to write a spellchecker for search queries in a web application - not unlike Google's "Did you mean?" The algorithm will be loosely based on this: http://catalog.ldc.upenn.edu/LDC2006T13 ...
1
vote
1answer
141 views

Build a map with city blocks and road

Is there a design pattern or well known algorithm to build a simple map with roads and city blocks? To have an idea of what's my target i describe some of the constraints and the context: a matrix ...
2
votes
2answers
204 views

How deep is enough to represent an algorithm in UML sequence diagram?

I have three simple classes. LoginController, UsersCatalog and User. UsersCatalog has an array of User. I have to represent a simple process of login. LoginController has a method login(username, ...
0
votes
3answers
169 views

Find second largest element in a array?

The problem is to solve it in n+logn−2 (base 2) no of comparisons. My algorithm is taking some extra space less then (O(n*n)). How can i reduce this extra space without increasing the complexity. ...
0
votes
3answers
113 views

Unique ID algorithm

I've got a route that contains objects. Each one has value 0 or 1. I need unique route ID which will identify any objects order. Currently I'm doing it using binary number that is converted to decimal ...
1
vote
1answer
212 views

Serpent Algorithm thats implement Cipher

How must i change the Standard Implemplementation of the Serpent Algorithm that i can use it with the javax.crypto.CipherInputStream or javax.crypto.CipherOutputStream? I must implement/extends the ...
-2
votes
1answer
269 views

Does implementing algorithms improve your programming skills? [duplicate]

I have been self studying algorithms and data structures for some time now and currently enjoying it. Whenever I understand an algorithm, I usually try to code them from scratch for fun and I always ...
1
vote
1answer
171 views

Algorithm to create permutations for a given alphabet based on a sequence number

I would like to have a function that will create a word (always the same word) for a given sequence number based on a given alphabet. word(0, [a,b,c]) = a word(1, [a,b,c]) = b word(2, [a,b,c]) = c ...
0
votes
1answer
60 views

When adding 7, 3, and 1 into a red-black tree, do I need to perform a right rotation?

If I add the following in this order into a red-black tree: tree.Put(7) tree.Put(3) tree.Put(1) 7 3 / rotate(3) / \ 3 -----> 1 7 ...
1
vote
1answer
108 views

Which Computer Vision / Image Processing technique would solve light imbalance in images?

Given a colour image whose light intensity is dim at the edges and bright in the middle, such as [dim bright dim], which computer vision technique would be recommended to correct this imbalance? ...
0
votes
0answers
57 views

Algorithm to calculate scheduling of task list, check feasibility [duplicate]

Problem I am trying to figure out how to best calculate a schedule as well as to check if for a set of tasks it is even possible to create a valid schedule for the following situation. Tasks have ...
-1
votes
1answer
126 views

Finding all subsets of a set running time

Given a set {1,2,3} output { {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3} } I have only been able to find as fast as O(2^n), is there any techniques for achieving faster results (besides ...
1
vote
4answers
172 views

How can the following algorithm be optimized?

I am currently working on a tic tac toe auto-mover game. I have come upon a decent algorithm that allows the computer to easily build towards, and claim victory spots. The problem however is that when ...
2
votes
1answer
112 views

Maze generation given intersection tree

Background Information: I'm building a 2D maze generator. I have tried Prim's algorithm, Wilson's algorithm, and a recursive backtracker algorithm for generating my maze, however was not satisfied ...
0
votes
2answers
184 views

Randomized Hash function with no collisions

Related to the question Which hashing algorithm is best for uniqueness and speed? Is there a way to create a hash function, or find one, whose hash length depends completely on the input length, has ...