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)

-2
votes
1answer
31 views

Considerations when making data structure and algorithm choices [on hold]

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

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

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 ...
0
votes
1answer
22 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
113 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 ...
1
vote
0answers
38 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 ...
-1
votes
0answers
39 views

How does Microsoft's Cortana or Apple's Siri map inputs to actions [on hold]

I was wondering what method Cortana, Siri, and similar software use to map user input to an action (e.g. show the weather or create a remainder). I don't care about speech to text software, I don't ...
5
votes
3answers
203 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. ...
0
votes
0answers
20 views

Range updates on sqrt decomposition (Mo's algorithm) [closed]

In the traditional sqrt decomposition algorithm, a point update and range query is allowed, both achieving O(sqrt(n)) performance. I'm wondering if it is possible to do range updates and range queries ...
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 ...
0
votes
1answer
49 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 ...
0
votes
2answers
104 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
70 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
66 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 ...
3
votes
1answer
84 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 ...
4
votes
1answer
53 views

Finding similar high dimensional vectors

I have two lists (sizes m and n) containing high dimensional bit-vectors. All vectors have the same number of dimensions and use Hamming distance as measure if distance. For each element in the first ...
0
votes
2answers
146 views

Optimization problem where to start, what algorithms to use? [closed]

I have an optimization problem and I was wondering where to start from to be able resolve it. I think it can be solved with an NP-complete algorithm but I am not sure where to start from. The problem ...
2
votes
2answers
70 views

Retrieving an incorrectly stored tree data structure

Way back in the hazy origins of our platform it was decided that we were going to need some hierarchical data structures stored in the RDBMS. The relationships between nodes were stored via a ...
2
votes
1answer
105 views

Improving sampling algorithm

I am having a bit of trouble designing a new feature at the moment. It is part of a resource management system. I was wondering if anyone has experience doing anything similar. I'll try to explain: ...
3
votes
1answer
89 views

JavaScript functional conversion from flat list to tree

I've been going through the RxJS tutorials http://reactivex.io/learnrx/. Almost all of the exercises involve moving from a hierarchical structure to a flat structure so I thought I'd try to do the ...
3
votes
0answers
55 views

Generate quantity distribution of objects to reach goal for each attribute

The Problem Suppose we are given a variable-length list of objects containing a fixed-length list of positive decimal numbers as attributes. JSON Example [ {a: 0.1, b: 0.6, c: 0.0}, {a: ...
4
votes
1answer
126 views

Name-Based Sorting Algorithms For Maximized Common Letters

I am attempting to write a program for a competition (we're allowed to consult Stack Exchange, as long as I'm not given physical code) that takes in a list of 5000 people's names (distributed fairly ...
2
votes
1answer
124 views

Algorithm to get all paths in a tree

I have a tree that has n-levels. For example here I have four levels: Each node has two children (except for the last one), however everyone except for the first and last node of each row has two ...
3
votes
1answer
99 views

Is this Red-Black tree insertion pseudocode from Introduction to Algorithms (CLRS) correct?

For the Red-black tree insertion fixup the book distinguishes between 6 cases, 3 of which are symmetric. The cases are (z is the node being inserted): Case 1: z's uncle is red Case 2: z's uncle is ...
5
votes
0answers
57 views

Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3

I am creating a 2d game for a website where the universe can grow extremely large (basically infinitely large). Initially, the universe is composed of 6 stars that are an equal distance from the ...
1
vote
4answers
138 views

Should I be using any algorithm to sort/find items, or use a language's built-in ways?

I'm currently a first semester IT student, and I'm wondering if it's better to write my method to find something e.g. in a C# List, or to use any built in method to do these, such as LINQ or .Find or ...
4
votes
4answers
258 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 ...
0
votes
1answer
69 views

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

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 ...
5
votes
2answers
98 views

Find path of steepest descent along with path length in a matrix

Came across this problem -- You are given a grid with numbers that represent the elevation at a particular point. From each box in the grid you can go north, south, east, west - but only if the ...
0
votes
0answers
188 views

What is a lattice parser?

My friend asked me for help with his task: "Redeem a lattice parser with any programming language" - the problem is that he can't clearly explain me how the lattice parser should work. I've tried to ...
6
votes
2answers
191 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 ...
0
votes
1answer
138 views

Do you know the name of this algorithm? (cycle with history?)

Context : I'm a IT student who is trying to implement a small application for my family. Every year, we offer each other gifts. Each one of us pick a name of a family member in a hat, and have to ...
1
vote
0answers
39 views

Graph grouping with criteria

I start with a list of adjacent tetrahedra, where there are tight seals to one another along faces for two tetrahedra that are adjacent. The vertices belonging to these faces for both tetrahedra are ...
4
votes
1answer
52 views

How to generalize the planar case of the closest pair problem to d dimensions?

I'm trying to create a solution for the Closest pair problem using d-dimensional points. I've done a thorough search on google but it seems that there is no explanation for the d-dimensional case ...
0
votes
0answers
22 views

Storing usernames and email addresses with hashes [duplicate]

I need to store usernames and email addresses with hashes, and not make them reversible back to their original values. This is for validating that I have their username or email address. The table ...
3
votes
4answers
311 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 ...
4
votes
1answer
115 views

Single Source Shortest Path

In the lecture we are taught that we can solve All Pairs Shortest Path(APSP) with matrix multiplication. In APSP we are creating a distance table for all the distances between each nodes in the ...
0
votes
0answers
67 views

Compute the permutations for a set of numbers and then run each to find every possible schedule that fits a client constraints

I am building a Java program that computes the permutations for a set of numbers and then runs each of those permutations to find every single possible schedule that fits a client constraints. The ...
2
votes
1answer
77 views

Algorithm for best subset of items

I have a matrix M with size NxN where each position M(i,j) is an integer representing the relationship between item i and j. If i and j are the same item then the positions M(i,j) and M(j,i) are 0. ...
0
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. ...
3
votes
1answer
94 views

Finding xor sum in a tree

I was trying to solve this problem on hackerearth where you have a tree with values on each node and you have to answer queries that ask what is the xor sum between two nodes. Also, there are updates ...
9
votes
4answers
446 views

What is the most efficient way to store this data?

I am in charge of rewriting some old VB code. I understand how it works, but I feel like there is a far-more efficient way to do what they did. I just can't figure out what it is. Here is a contrived ...
0
votes
2answers
302 views

How to scramble a word, keeping first and last characters the same?

I have a task, which is to scramble a single word, whose size is greater than 3 letters. The scrambled word must not be equal to the original, and the first and last letters of the word must remain ...
14
votes
2answers
427 views

How to find hard to misspell given names?

Here is a question that I believe could be solved with some data mining and a sophisticated algorithm, but I don't quite know how. Any pointers as to what data sources to use and what algorithm to ...
1
vote
3answers
172 views

Data structure for sorting by multiple attributes

I have a list of integer pairs. The value of this list is the sum of the maximum values of each pair. For (0, 5) (20, 5) (6, 8) the value would be 5 + 20 + 8 = 33 Given a list like ...
6
votes
1answer
161 views

Identifying plagiarized jokes? [closed]

I'd like to be able to identify duplicate jokes posted on a website. I can build up a reasonably large database of previously-posted jokes, and then I'd like to look at each new joke as it comes in ...
4
votes
0answers
145 views

Combinatorial Optimization: Filling a Bag with Sand

I have an interesting "real-world" combinatorial optimization problem that I need to solve programmatically, however I have yet been able to whiteboard a good strategy. The task is similar to the ...
5
votes
1answer
58 views

Finding the smallest sub-collection of sets that intersect to produce one element

I came up with a problem that's similar to the Set Cover problem but which I can't reduce down to any know problem. Does anyone have a good algorithm for solving this? Given a set of elements U = {1, ...
-1
votes
1answer
91 views

Sorting an array based on another array's order, quickly [closed]

There are two arrays of maps. The first array contains maps of ID values in a specific order (but not necessarily either pure ASC or DESC ordering): // pseudo code first := [ {"id": 1}, ...
2
votes
1answer
76 views

Using a user defined equation to compute an entire list of numbers and store the list in an array

A example of what I want to do: User puts numbers into a list on a GUI that looks like this | L1 | L2 | l3 | ---------------- | 3 | 6 | | | 5 | 3 | | ... He writes in a text area ...
-1
votes
2answers
98 views

creating a social trend algorithm [closed]

I want to try to create an algorithm that would rank links according to social trends. I've article links, I've their date of publishing. I also have data from Facebook: comments, shares, likes. My ...