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
4 views

How to “de-dupe” similar lines (detected using the Hough Transform as rho/theta pairs)

I'm trying to identify an object (a cube) in a set of photos. Using Canny/Sobel/Hough I've managed to get the photo down to a set of lines that are pretty accurate; however if I plot these lines on my ...
0
votes
1answer
229 views

Laravel Algorithm for taxi app

I am trying to write a backend for a taxi service (university assignment) and I am stuck on the algorithm. whenever a new client posts a request, all the taxi drivers nearby get an email notification ...
-4
votes
0answers
39 views

How many ways to get a fixed number that is the sum of three numbers? [on hold]

Let's say you want to find out how many ways there is to make the number 5 using three numbers, which are added together. These are some of the ways: 005 => 0 + 0 + 5 = 5 122 => 1 + 2 + 2 = 5 ...
12
votes
7answers
5k views

Generating random math expression

I have this idea running around in my head, to generate and evaluate random mathematical expressions. So, I decided to give it a shot and elaborate an algorithm, before coding it to test it. Example: ...
-6
votes
0answers
18 views

How do I write a reddit bot which will post stuff on a daily base? [on hold]

I want to program a bot for reddit. Where do I start? I need to solve following things (in pyhton): Log in with an account. Post comments on threads in a special subreddit. On a Daily base. For the ...
2
votes
1answer
392 views

Grouping algorithm

We've developed an algorithm that depending on the check-in time of some workers and their living place, calculates the way to group them into some vehicles and the route which must be followed by the ...
-4
votes
0answers
24 views

How to calculate the runtime and compare them? [duplicate]

The asymptotic notations are very confusing. Can someone help me on how to calculate the run times? For example: big O for the following loop -- sum = 0; for (i = 1; i < = n*n; i++) for (j = ...
-5
votes
0answers
181 views

What can an algorithm look like that chooses appropriate images or songs? [on hold]

My goal is to automatically create a slideshow of images if either a directory or images or an audio file is given. In the former case, software should find an appropriate audio file from a library. ...
-1
votes
1answer
96 views

What is the 'Basic Operation' of a block of code? [on hold]

During my lectures on advanced algorithms my professor has been giving us statements of code and asking us to determine the 'most basic operation' of that block of code. It's a bit ambiguous and my ...
4
votes
4answers
309 views

How to design a function that takes a date and gives out a number between 1-6, always the same for all dates

As a part of an algorithm I'm making I need to make a function that takes the current date to a function and gives out a number between 1-6, and not the same number for two consecutive dates. And it ...
1
vote
2answers
69 views

Find all paths in a tree type of structure

The language I am using is C#, but I am looking more for help with the algorithm more than I am concerned with which language. I have been trying to develop this algorithm for a while now and I can't ...
-1
votes
0answers
38 views

Best many to many match and sort algorithm

Im looking for best algorithm to match and sort many to many values I have "book" which have many orders in many stacks (max capacity of stack is for example 10). Each orders have many products. Each ...
-1
votes
1answer
77 views

Algorithm for solve combinatorics (clique search)

We have a group of animals: animals = {'dog', 'wolf', 'cat', 'lion', 'rabbit', 'bear'} And know a list of conflicts conflicts = ( {'dog','cat'}, {'dog','rabbit'}, {'wolf','rabbit'}, ...
0
votes
0answers
94 views

Interaction between code and user interface

I'm developing a desktop app that has many different algorithms implemented. Some algorithms require additional input from user, this info might not be known before algorithm has started. My ...
0
votes
1answer
93 views

Algorithm to get all possible forms of a word with varying suffixes

I'm writing an application in javascript where given a word, I need to get all the possible versions of the word with the suffix being the difference between each form. For example: "sponsor" should ...
2
votes
6answers
741 views

Find pattern in a string [on hold]

How would one approach the following question: We have two strings: a normal alphanumeric string and a pattern string. the pattern string can be composed by alphanumeric chars plus the char "?" ...
3
votes
4answers
183 views

Selecting a CPU or microcontroller needed for a given software application?

Say I had a software algorithm (for example, an FFT), and I need it to process (n) amounts of data in (t) milliseconds. This is a real-time task written in C. There are a lot of CPUs out there, and ...
0
votes
0answers
16 views

Extract the main entity from a body of text for text categorisation?

I'm trying to categorise products based on various fields of data. I've had some success just matching search terms in the product names, but this naive approach doesn't work when it comes to larger ...
3
votes
3answers
189 views

Method for determining if a line segment is an external edge of a Delauney triangulation?

I've created a Delauney triangulation of a set of points. Now I want to iterate over the triangulation and remove any line segments/edges on the exterior for which the following are true: The ...
8
votes
2answers
2k views

Name of the Countdown Numbers round problem - and algorithmic solutions?

For the non-Brits in the audience, there's a segment of a daytime game-show where contestants have a set of 6 numbers and a randomly generated target number. They have to reach the target number using ...
-1
votes
1answer
75 views

Create arithmetic expression from number using +-/* that equals target [duplicate]

For example, you are given the source 1234 and the target 24. The task is to use the standard arithmetic operators +-/* placed within source, without changing the order of the digits of source to ...
0
votes
1answer
24 views

Implementing CMA-ES

I am attempting to implement the CMA-ES optimization algorithm in my favorite language (using the example code here as a guideline), but I need help solving a problem I am having. To test the ...
-2
votes
1answer
35 views

Considerations when making data structure and algorithm choices [closed]

What are some reasons you may choose a worse runtime algorithm? And what are some advantages of a linked list vs a hash table/array where access is constant time.
-4
votes
0answers
22 views

Getting directions using my own voice samples regarding a gpx track [closed]

My goal is to create an app in android that loads a gpx track Compares my gps position to the track and gives me directions using my own voice (samples) as in Go to the right soon Go to the left ...
30
votes
8answers
20k views

What methods are there to avoid a stack overflow in a recursive algorithm?

Question What are the possible ways to solve a stack overflow caused by an recursive algorithm? Example I'm trying to solve Project Euler problem 14 and decided to try it with a recursive ...
2
votes
1answer
122 views

Word game algorithm

Back in the days of 8-bit machines there existed an educational word game. I have no idea what it was actually called but for the sake of this question (since it involves pyramids) let's call it ...
7
votes
3answers
244 views

Generate equally sized areas in polygon

I am looking for a pseudo code logic that would find n equally sized areas in a given polygon. No space should be between or outside the matched areas. First valid match of areas should be returned. ...
4
votes
1answer
154 views

Detecting surface faces of a huge 3D mesh/grid

I've written a module in my application that creates a mesh from existing coordinate and face data. The number of vertices in the mesh could easily exceed 10 million and the same goes for the faces. ...
3
votes
4answers
327 views

Which algorithm is performant for matrix multiplication of 4x4 matrices of affine transformations

I am wondering what is a good, performant algorithm for matrix multiplication of 4x4 matrices. I am implementing some affine transformations and I am aware that there are several algorithms for ...
13
votes
2answers
1k views

How did Strassen come up with his matrix multiplication method?

The famous Strassen's matrix multiplication algorithm is a real treat for us, as it reduces the time complexity from the traditional O(n3) to O(n2.8). But of all the resources I have gone through, ...
1
vote
0answers
43 views

Find minimum number of steps to a goal without estimator for how close intermediate steps are to the goal

I've been trying to find a good way of solving the following problem, but I'm not sure how to even frame it. I think there might be relatively well-known solutions I'm not familiar with, since I don't ...
5
votes
6answers
391 views

Algorithm for determining transactions among weekly data series?

I'm trying to develop a small reporting tool (with sqlite backend). I can best describe this tool as a "transaction" ledger. What I'm trying to do is keep track of "transactions" from weekly data ...
8
votes
2answers
2k views

What are algorithmic paradigms?

We generally talk about paradigms of programming as functional, procedural, object oriented, imperative etc but what should I reply when I am asked the paradigms of algorithms? For example are ...
33
votes
8answers
13k views

When to use DAG (Directed Acyclic Graph) in programming?

I recently found a framework named ecto. In this framework, a basic component named "plasm", which is the ecto Directed Acyclic Graph.In ecto, plasm can be operated by ecto scheduler. I am ...
0
votes
1answer
104 views

Finite Element Shader

I am working on a geometric wrapper for a space jet exhaust impingement solver. A key part of the solution is determining what the jet can "see" and therefore hit. My model is grouped with nodes or ...
1
vote
1answer
272 views

Generating combinations algorithmically

Suppose I have an n-high pyramid of numbers like: 1 5 8 2 5 4 8 9 3 1 2 8 3 7 2 How can I algorithmically walk through every possible path from the top of the pyramid to the bottom? To ...
3
votes
1answer
229 views

Image segmentation - show or hide clusters

I'm trying to make a small program in c#, that will downsample image to specified amount of colors (using K-means). Then, user will be able to hide\show colored areas(clusters) in image. I've ...
20
votes
3answers
13k views

What does it mean to say an algorithm is Sound and Complete?

I heard different interpretations of sound and complete. I understand that completeness means finding a solution if there is one. What does it mean to say an algorithm is sound. What does it mean ...
6
votes
2answers
194 views

Efficient algorithm to merge n successive sorted arrays in place

I am developing an in-place sorting algorithm that leaves the array into a state where it is basically a succession of sorted subsequences of any size (most are bigger than log2(size(array))); then it ...
2
votes
0answers
34 views

Polygon simplification that encloses original set of points

I have been trying to implement an optimization for 2D sprite rendering to fight the problem of limited fillrate on mobile devices. The idea is to render textured polygons instead of quads that will ...
31
votes
9answers
6k views

Is the algorithm more important than the programming language?

During the current (2013) Google Code Jam contest, there was a problem that took C++ and Java people 200+ lines of code as compared to Python people that solved the same problem only using 40 lines of ...
0
votes
2answers
110 views

How to approach hours forecasting

I have a django web app and I basically need to forecast budgeted hours for 2 departments to help them schedule staff as currently the best they can do is just wing it. When we receive a job proposal ...
-3
votes
1answer
71 views

How are things like lists allocated in memory? [closed]

When I read about amortized analysis it mentions how when a list is full it has to re-allocate a list of even bigger size and copy all the elements over. My questions: Where is the list stored in ...
1
vote
1answer
287 views

Split multiple overlapping intervals to non overlapping intervals

currently I try to build an algorithm to split an array of overlapping intervals to a new array with non overlapping intervals. For example: Array of overlapping intervals: [ {0,7}, {8,12}, ...
2
votes
1answer
67 views

Divide the world map into fixed sized blocks

I am developing an app where I need to divide the entire world map into fixed sized square blocks. For simplicity, think of it as a problem of dividing the google maps into a fixed sized block. I can ...
-1
votes
3answers
134 views

Balanced folder increment

I want to map an integer (let's say 32bits) to a valid path. The integer is an autoincrement value stored in the database. I also don't want at any case any folder to have more than N subfolders. ...
2
votes
1answer
92 views

Burrows-Wheeler transform backward search: how to find suffix index?

BWT backward search algorithm is pretty straightforward if we only need the multiplicity of a pattern. However I also need to find the suffix indices (i.e. positions in the reference string where a ...
3
votes
1answer
86 views

Prorating a license (its expiry) dependent on feature add-ons

I've ran into a problem trying to calculate prorating of a service. Hoping to get some help/hint from the community. I apologize if this isn't the right place to ask this question - will appreciate ...
1
vote
1answer
192 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 ...
3
votes
2answers
795 views

What does 'upper bound' mean in context of BigO?

My computer science teacher says Big O has an upper bound but no lower bound. When I look at a graph of an algorithm mapped out using BigO though, there isn't an upper bound at all. The upper limit ...