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
0answers
32 views

Looking for a Treemap tiling algorithm

I'm looking for an algorithm to convert a tree of data into a 2 dimensional treemap view. http://en.wikipedia.org/wiki/Treemapping I can do all the coloring in and drawing myself, but if there was ...
1
vote
2answers
118 views

Approach to coding algorithms to minimize rework [closed]

I find myself reworking my code quite a bit, especially when learning to write algorithms that involve keeping track of multiple attributes and labels. I feel that having the pseudo-code written up, ...
1
vote
1answer
43 views

Algorithm for detection of overlapping between vectors

I am currently developing a math-physics program and I need to calculate if two vectors overlap one another, the one is vertical and the other is horizontral. Is there any fast algorithm to do this ...
0
votes
0answers
59 views

How to Detect Sprites in a SpriteSheet?

I'm currently writing a Sprite Sheet Unpacker such as Alferds Spritesheet Unpacker. Now, before this is sent to gamedev, this isn't necessarily about games. I would like to know how to detect a sprite ...
3
votes
1answer
58 views

Applying the Art Gallery problem to optimal sensor placement

I am trying to design an algorithm for optimal sensor placement in a given area. After doing some research I found the Art Gallery Problem. However, this problem assumes that the guards can see all ...
1
vote
1answer
93 views

Memoization Memory

Memoization is definitely a powerful technique. But Dynamic Programming is slightly better IMO, since it does not involve the memory strain (in a recursive program, the parameters occupy memory and ...
0
votes
0answers
144 views

what is the meaning of f(n) = O(g(n))? [duplicate]

I am reading 'Algorithm design manual' book by Steven S. Skiena. I would like to know what is f(n) and g(n)? I am a programmer and wanted to gain more knowledge about algorithms but now I am confused ...
7
votes
4answers
696 views

Apple eating problem

Player A and Player B play a game. On the middle of the table there is a pot full of N apples of different weights. Player A starts first and choose an apple and start eating it. Losing no time player ...
1
vote
0answers
26 views

Colour curves tool for “value” channel

I'm trying to write a program to read GIMP curves files and apply them to an image. I have successfully implemented the curves for the red, green and blue channels, but I can't get it working for the ...
2
votes
1answer
88 views

Programming conundrum - most efficient path

I have a non-language-specific problem which I'm having trouble finding a workable answer for. I have a 10x10 grid containing integer values from 1-10. Each value represents the cost of travelling ...
5
votes
1answer
74 views

Coming up with a valid ranking algorithm for articles

I'm creating a website which will publish one or more articles a week. I'd like to be able to rank the articles based on popularity. In order to do this, I need a formula to calculate a score for ...
0
votes
2answers
106 views

How to draw a spiral using segments of varying circles?

I have an old plotter that can't handle printing true spirals. I need help with developing an algorithm to approximate a spiral. Here's a LISP sub-script that I have written which uses semicircles ...
0
votes
0answers
39 views

Algorithm for Testing interoperability

I am writing a php script that carries out a task. One input is a list of options that I need to test for interoperability. If the options are A B C then I need to test every combination, but I only ...
2
votes
2answers
143 views

Is there any use for a smart algorithm developer who will delegate the coding?

In my job as an algorithms developer, I am responsible not only for developing algorithms, but also for implementing them, all the way down to writing the code that goes into production. I've heard ...
1
vote
2answers
100 views

Algorithm for searching images within images [closed]

I can't google this question, because I can't come up with a good query, so let me describe what I want and maybe someone will be able to suggest a way forward for me. I need to solve the following ...
3
votes
3answers
372 views

Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?

I have some JSON data in this format (5,000 instances for now): {"id":"123456","icon":"icon.png","caseName":"name of case"} I am allowing the user to search for the name of the case and then return ...
1
vote
1answer
17 views

Given n distinct keys, how many different 2-3/Red-black trees can be constructed?

Memory refresher/My understanding: A 2-3 tree is a balanced search tree that allows two types of nodes. 2-node: Normal node with two children. LChild < Parent and RChild > Parent 3-node: ...
0
votes
4answers
274 views

Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?

I wish to search for an integer in a vector of integer. I have two candidates for the job: Binary Search Find It seems that Binary Search is the best candidate for the job as although I have to ...
0
votes
3answers
127 views

Sorting an array when values are decreased by each swap [closed]

Recently in an interview I come across a question: We have an unsorted array, we need to sort it with minimum number of swap. We have in sort a 'tax' of 1 is deducted from the number we are ...
0
votes
0answers
74 views

Storing simple / flexible pricing logic in the database

I am working on a pricing algorithm where I want to generalize the calculation of certain components/charges. There are 3 components to the charges. 1 - a basic/core charge, 2- a handling charge ...
0
votes
1answer
139 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
2answers
200 views

Is Pre-Order traversal same as Depth First Search?

It seems to me like pre-order traversal and DFS are same as in both the cases we traverse from root till the left branch and back to root and then to the right branch recursively. Could any please ...
3
votes
1answer
221 views

What are the essential mathematics topics that a programmer should know in order to learn algorithms? [closed]

Being a electronics engineer, I was never exposed to any algorithms. Now I am a experienced programmer and want to learn Algorithms. I started with CLRS. But I was overwhelmed by the maths in the ...
0
votes
1answer
53 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 ...
1
vote
1answer
48 views

Finding minimum path with return?

I'm having trouble understanding a past quiz question I got: Bobby works at Starbucks in San Mateo (V). He is doing quality assurance testing and needs to visit stores in Palo Alto (B), Tenderloin ...
3
votes
1answer
105 views

Need an optimization algorithm

I need this algorithm for one of my projects. I will paraphrase the problem. There are 'n' ropes that have different colored rings on them. (The colors might repeat on the same rope or across ...
0
votes
1answer
60 views

What algorithm pairs blocks so that the weighted average of the two blocks falls within an upper and lower bound?

What algorithm would pair parcels with a high proportion of property x to a parcel with a low proportion of property x so that the weighted average of the two parcels falls within an upper and lower ...
-2
votes
4answers
122 views

Algorithm/research on detecting language of text [closed]

I am interested in finding an approach that will detect what language a string of text is. As Google translate does.
2
votes
4answers
276 views

difference between exponential and logarithmic growth

Why for(k=1;k<=n;k*=2) grows logarathmically = O(logn) but I feel it grows exponentially, as the seq look like 1,2,4,8.... and for fibonacci series people say it grows exponentially. which for me ...
3
votes
3answers
78 views

Detect Order Changes in a List

Let's say you have a list of values that are a b c d e The order on the list might be changed. a c d b e How would you detect this change? We needed something like this when we were ...
0
votes
3answers
96 views

How to limit time period to another period?

For a project planning I have an initial period, lets call it PPStart-PPEnd. The planning is associated with a project. This also has a period PrjStart-PrjEnd. PrjStart and PrjEnd are fixed, and can ...
0
votes
0answers
47 views

Distributing Contestant Entries Between Multiple Bins, Is this Knapsack?

I am an algorithm novice and am faced with a rather difficult problem. I working with contest's. There are contestant - individual player entry - contestants can have multiple entries into a ...
3
votes
4answers
258 views

Which mathematical properties apply to XOR Swap algorithm (and similar bitwise operator algorithms)?

Assume you have two variables a and b, and you need to swap them, and for whatever reason, making a temporary variable for storage is not an option. This is the algorithm in pseudocode a ← a XOR b b ...
1
vote
1answer
59 views

Mapping values over a curve

I have a value between 0 and 8000 and I want this number to resolve to another number between 0 and 2000. I could just divide it by 4 but I have a special need here. For values above 4000 I want the ...
0
votes
5answers
239 views

Mapping 40 unique integers to 41 and back

This was a question proposed by a friend of mine. Define an algorithm that, given 40 unique integers in the range 1-1000, returns 41 unique integers in this range. Given these 41 integers, we must ...
-1
votes
1answer
101 views

Possible number of combination for SSNs [closed]

The SSNs or Social security numbers having the range {0,1,2,3,4,5,6,7,8,9}, as the conditions are-> 'o' cannot be the first number for an SSNs, -> repetition of number is possible, ...
1
vote
2answers
64 views

How to reduce close points

input: C matrix 2xN (2D points) output: C matrix 2xM (2D points) with equal or less points. Lets say we have C matrix 2xN that contains several 2D points, and it looks something like that: What we ...
0
votes
1answer
54 views

expressing the speed of a sorting algorithm

How would I express the speed of the following sort algorithm? I know bubblesort is n^n (er, I mean n^2...as someone pointed out below). In the following the array decreases each time you call it ...
1
vote
0answers
109 views

What is the purpose of chunking strings in natural language processing?

I see many examples of libraries that use a 'chunker' and also people asking how to write chunkers, but what is this for and why do we need it? Isn't it enough to split a text by whitespace or other ...
1
vote
0answers
65 views

R* Tree work with dynamic data

I'm searching an algorithm to store my data (which are moving objects' coordinates) and allow me to query objects within a specific radius of a specific point. I came up with R* Tree which is said as ...
2
votes
0answers
125 views

Match buyers and sellers based on date ranges and quantity of shares

NOTE: This is in reference to the question I asked on Stack Overflow but was told to post this here I'm building a trading application that matches buyers/sellers that own subscription. Subscriptions ...
1
vote
0answers
101 views

Is that concept of securing connection between telephone and server makes sense [closed]

This topic is on concept level right now. I know that you like straight-forward questions, but I really need an expert look on all of this. (I am still a student, this is not commercial by any means) ...
6
votes
3answers
165 views

Maximizing number of nested triangles

There is a finite set of points on a plane (about 1500 points in the current task). I need to construct triangles on those points such as each triangle lies completely inside one larger triangle: ...
2
votes
0answers
72 views

Solving geometric constraints with Minion

I am doing research on squares, and I thought of using constraint-satisfaction-problems solvers for proving or disproving some conjectures. As a simple example problem, consider the following task: ...
1
vote
2answers
191 views

2 closest points between 2 rectangles

On a 2D plane, I have 2 rectangles. I want to find the closest pair of points (one on each rectangle), which are closest to each other. By points I mean the corners of the rectangles. And no, they do ...
0
votes
0answers
51 views

Creating A News Feed with Relevant Data for App

I'm creating an app that currently allows users to create topics, vote in topics, follow topics, and chat in topics. Currently working on creating a News Feed like Facebook or Twitter that brings ...
1
vote
2answers
113 views

Algorithm for defragmenting cross-pipe issues in a network for routing signals through?

I have a network I'm responsible for routing signals through. You can think of the network as a directed graph of nodes (hardware) but each edge is really a pipe capable of fitting a specific ...
2
votes
1answer
214 views

Is there already a “Binder” data-structure?

I was thinking of a data structure that I cannot describe better than with the word "book", or more exactly "binder". I was wondering if this had already been implemented in libraries like Boost or ...
1
vote
1answer
80 views

Implementation/Representation of Symmetries in Chessboards

In a 8X8 chessboard, I was wondering how to implement the symmetry of the board. A lot of positions are just mirrors or rotations of one another (with no pawns or castling capabilities left the ...
0
votes
1answer
110 views

detect if a combination of string objects from an array matches against any commands

Please be patient and read my current scenario. My question is below. My application takes in speech input and is successfully able to group words that match together to form either one word or a ...