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)

8
votes
0answers
130 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 ...
5
votes
0answers
98 views

Algorithm to generate all sets of m points in n x n x n cubic lattice which are unique under symmetry

I am implementing an algorithm which is going to be quite computationally complex, and want to try to make sure I'm not doing unnecessary work. There is an n x n x n cubic lattice, e.g. if n=2 this ...
4
votes
0answers
69 views

Modelling a complex schedule of work

I've got a real-world problem that I'm trying to represent and automate. I've simplified and abstracted it down to the following: There are n places of work (P1, P2, ..., Pn). Each place, Pn has a ...
4
votes
0answers
494 views

Dynamic programming in Bin packing

Problem: Given a list L of objects of possible sizes from set S={1,2,4,8} and unlimited supply of bins of sizes 16 each and we have to use minimum possible numbers of bins to pack all objects of L. I ...
4
votes
0answers
287 views

Help/suggestions for Parallel assembly line scheduling (Dynamic programming)

I am working on a problem similar to the assembly line scheduling by dynamic programming.The issue is that unlike the classic problem where we have predefined stations now I only have information ...
3
votes
0answers
62 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: ...
3
votes
0answers
146 views

How to distribute a number of elements in a bucket so that it is within a range?

I have 50 elements n1, n2, n3, ... , n50 and a limited number of buckets, say 5 buckets and each bucket can hold a range from, say 100 to 150 only (which is nothing but the sum of the elements in that ...
3
votes
0answers
378 views

Fast fixed-size (256 bit) integer modulo/division

What is the fastest way to divide two 256-bit integers? They are represented as an array of 26-bit words, each stored in 32-bit integers. I have access to a 64-bit type if that's useful. It seems ...
3
votes
0answers
131 views

Smallest number of rectangles covering marked parts of grid

I have an N by N grid of cells, and certain blocks are marked: +--+---+---+---+ | | | | | | | x | x | | | | x | x | | | | | | | | | | | x | +--+---+---+---+ I would like to ...
3
votes
0answers
282 views

What algorithm is this?

I have some vague recollections from my algorithms courses, but nothing specific comes to mind. let S be a multiset of things we are interested in. As input, we get T, s1, s2, ... sn, all of which ...
2
votes
0answers
50 views

Are there any generic algorithims or Python functions to help find the longest item in a JSON document?

I am trying to log a JSON error message to Google's Cloud Logging platform. Unfortunately, the maximum size message you can log is 8000 bytes and some of the JSON documents I want to log are larger ...
2
votes
0answers
51 views

Restricted randomization of a binary vector

Suppose I have a binary vector of sample size N with each of the two possible values (e.g., 0 and 1 occurring equally often). For example, if N=10, the binary vector is: 0 0 0 0 0 1 1 1 1 1 Suppose ...
2
votes
0answers
40 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 ...
2
votes
0answers
181 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 ...
2
votes
0answers
110 views

Predicting package delivery schedules

I'm trying to solve the following problem: A delivery man has N packages to deliver, already sorted. He starts the route at start_time, he works until end_time. I have historical data of his ...
2
votes
0answers
127 views

Creating a better mouse dragger function

I originally posted this to code review, not knowing incomplete code was off-topic and was pointed to post here. I don't believe this question is a good fit for stack overflow because the code I ...
2
votes
0answers
49 views

Project a piece of image cut by N-vertex shape to a different N-vertex shape

I have an N-vertex shape that I cut out from an image, and I want to project it onto another shape with the same amount of vertices, but different. So, the image will get changed inside the ...
2
votes
0answers
55 views

Optimizing trigram look ups with wildcards

I am working on creating a spell-checking service for Android (note: this is a platform- and language-neutral question) for Asturian, a minority Romance language. We're using hunspell as the base but ...
2
votes
0answers
112 views

Asking questions to the user based on results of previous questions

I have to select a question that would help me make me sure the user knows about a given subject. As an example, let's assume the user hasn't answered any question yet. Every question has a scope ...
2
votes
0answers
162 views

Design an algorithm with network flow

Given a matrix A with 0 and 1 entries. Neighbours of a[i,j] are a[i-1,j], a[i+1,j], a[i,j-1] and a[i,j+1] (if exists any). Tow neigbour entries are an Improper pair if they have not equal values. if ...
2
votes
0answers
186 views

Walk Tree vs Zhang and Sasha Algorithms

I need some help understanding how two tree comparing algorithms differ. I am working with Microsoft's XmlDiffPatch (http://msdn.microsoft.com/en-us/library/aa302294.aspx) which compares two xmls. The ...
2
votes
0answers
159 views

Incorporating custom Algorithm in SOLR-LUCENE , before Indexing?

CURRENT FLOW: I am using a custom algorithm(presently in php) to rank the MYSQL records before INDEXING it to SOLR . WHAT I WANT : Is it possible implementing this ALGORITHM(may be in JAVA) inside ...
2
votes
0answers
782 views

How to find minimum weighted vertex cover of a tree, and confused about a solution

Studying for my algorithms test by spamming Algorithm Design Manual exercises, but I'm stuck on this one. I know I have to keep score somehow. Let G = (V,E) be a tree with arbitrary weights ...
2
votes
0answers
74 views

Calculating “instability score” for connection quality, programmatically

First of all, apologies if this is posted in the wrong site. I thought it is more suitable here than SO because the question is quite generic, more an algorithm question than a specific programming ...
2
votes
0answers
166 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
0answers
262 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 ...
2
votes
0answers
201 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: ...
2
votes
0answers
257 views

Generate complex (non-convex) polyhedron UV mapping

I need to find an approach to the problem of generating texture maps for non-convex polyhedrons without using a design tool like Maya. Specifically, I am mapping simulation results data onto a 3D ...
2
votes
0answers
115 views

data stored in dbase (application result dd.mm.yyyy)

I have a .dbf file (dbase) with data of type "date" to read directly via php. I have the application result (format: dd.mm.yyyy) and the stored hex code. I can't interpret the hex data to get the same ...
1
vote
0answers
37 views

Most efficient way of allocating participants to conference tracks

I am redesigning a system by which conference participants can choose which track they want to attend. Participants express their track preferences arranging them in order and submitting them at a ...
1
vote
0answers
58 views

Resource Allocation Algorithm

I have a question about assigning values to nodes laid out in a physical space: There is a set of N fixed nodes spread out throughout a certain 2 dimensional region that need to be assigned a value ...
1
vote
0answers
41 views

Filtering algorithm for word game

Suppose you have a number of anagrams for the same letters, for example: alerting altering integral relating triangle Suppose you have a game where you must find all the anagrams, by placing letters ...
1
vote
0answers
56 views

Implementing an algorithm for parallel task scheduling

Problem Given a set of applications "A[]" with execution cost "Ex" ,Arrival Time "t", Resource requirements "R" and the system having free resources "Fr", calculate the finishing time of all of the ...
1
vote
0answers
24 views

Create unique buckets for stream of entities based on constraints on the entity attributes

I have stream (magnitude 10s of millions) of entities, say Item which is modeled as below: class Item { String id; Double price; Double profitPercentage; Country originCountry; Country ...
1
vote
0answers
119 views

Which 3D algorithms does Windows 10's “3D Builder” application use?

Windows 10 ships with "3D Builder", a Universal App that contains utility functions to prepare STL, OBJ, 3DS, and other files that represent geometries for 3D printing. The utility looks like this: ...
1
vote
0answers
46 views

List all intervals made by inherited array of intervals

i have a grading system which works like this: You have a array of intervals with grades: [9, Inf) => A; [7, 9) => B; ... (-Inf, 1) => F But you can create also inherited grading system ...
1
vote
0answers
43 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 ...
1
vote
0answers
88 views

Belman-Ford 2d array variation problem

I've got a problem with applying a Bellman-Ford algorithm to 2D Array (not to graph) Input array has m x n dimensions: s[1,1] s[1,2] ... s[1,n] -> Exit s[2,1] s[2,2] ... ...
1
vote
0answers
103 views

Finding the longest acyclical path in a 2D maze

I have a n by n maze, like this: [0, 1, 0, 0, 0, 1] [1, 1, 0, 1, 1, 0] [1, 0, 0, 1, 0, 1] [0, 1, 1, 0, 0, 1] [0, 0, 0, 1, 0, 1] [1, 0, 1, 0, 1, 1] Only 0-fields are passable, and one can only move ...
1
vote
0answers
73 views

Generate a fixed length number hash from a number

Let say I've a fixed length number, e.g. 6 digit: 837493, I want to apply some process (with a salt), and generate a new number of another 6 digits, e.g. number = 837493 another = hash(number + ...
1
vote
0answers
83 views

distribute rectangles in order to do not overlap

I've a series of labels and icons inside the screen. A label is on the right of corresponding icon. I must perform a sort of declutter: when two or more labels overlap each other (or a label with an ...
1
vote
0answers
47 views

Matching data based on multiple parameters and certain limits

I've been looking into the k-nearest neighbors algorithm as I might be developing an application that matches boxers in the near future. The reason my for question, is to figure out which would be ...
1
vote
0answers
47 views

Recursive(?) algorithm design help

I have a requirement to allow my end users to input formula much like a spreadsheet. I have an array like this: $table = array( 1=>array( "id"=>1, ...
1
vote
0answers
99 views

Search algorithm on sequential data model

For sequential data models like LinkedList, search algorithms like linear-search and binary-search are well known. Are their any other search algorithms apart from these two, that work on sequential ...
1
vote
0answers
108 views

Efficient extensions of degree of separation

I'm trying to play around with the 6 degrees of separation problem, specifically the Kevin Bacon game to find alternative ways of playing the game. I want to eventually port it over to MapReduce, but ...
1
vote
0answers
83 views

Choose a number of arrays which have the smallest cardinal number when unified

Say we have multiple arrays: var a := [1, 2, 3] var b := [2, 3, 4, 5] var c := [1, 3, 4, 6] var d := [1, 2, 5] We want to find the three arrays with the smallest cardinal number when the three ...
1
vote
0answers
135 views

Reversing dithering algorithms?

I was trying to make an implementation of the Floyd-Steinberg dithering algorithm in Python, and I was wondering, since Bitmaps files store their data starting from the bottom-left corner, would it be ...
1
vote
0answers
88 views

Combining items from several lists with pagination

I am trying to come up with an algorithm for getting items for a news feed from several sources. There are multiple lists of data: S1, S2, ... Sn. Each of these lists has a certain known amount of ...
1
vote
0answers
54 views

Can't figure out how to parallelize the calculation of the amount of offspring expected for species in genetic algorithm

I developed a genetic algorithm in java 8 taking advantage of its reasonably free parallelism opportunities with Streams. As you are likely aware, running the epochs takes its time for even a test ...
1
vote
0answers
69 views

PSO – how Dimensions are set up?

I am coding a Particle Swarm Optimization in C++. I have been for days trying to understand the theory of how dimensions work in each different problem. In the many examples I have seen, all of them ...