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

What should i learn to create a Virtual Reality World? [on hold]

I'm computer engineering student. Actually more than knowing the answer of this question, i am trying to find ways to make myself code more programs. But this is what i am interested on. For a long ...
1
vote
1answer
104 views

Algorithm for rating books: Relative perception

So I am developing this application for rating books (think like IMDB for books) using relational database. Problem statement : Let's say book "A" deserves 8.5 in absolute sense. In case if A is ...
1
vote
0answers
21 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 ...
0
votes
0answers
54 views

Similar problem to word break

I have a list of strings say L and an array of words say A. I want to find a string from the list L that is a best match to a string created from the permutations of the words in the array. The ...
3
votes
0answers
43 views

Data structures and algorithms for a directed rooted tree with inherited properties?

I need to represent a directed rooted tree in memory. The caveat is, that nodes have properties. And those properties are inherited (but not 100%) by the child nodes, recursively. What would be a ...
4
votes
4answers
601 views

How to rotate an array of bits

I currently have a PIL Image object which I store as an array of bits (1's and 0's). However I now would like to be able to rotate that image 45 degrees. One way to do it is take the original PIL ...
0
votes
4answers
277 views

How to manually detect deadlocks

I understand the concepts of deadlock well enough, but when I'm given a problem like the one below I'm not sure how to go about solving it. I can draw a resource allocation graph, but I'm not sure how ...
0
votes
0answers
33 views

What is the best way to sort strings with multiple words in each line and is separated by newline in Java? [migrated]

I have list of anime that i have watch uptill now and i want to sort them in alphabetical order. Below is the small example of how the list is and there are over 200 lines. I have stored all of them ...
0
votes
1answer
45 views

Algorithm for tiling a surface with no adjacent tiles

I am looking for an algorithm that does as follows: Given a 2D grid of X,Y and a number of tiles T, places a tile in each cell of the grid such that the surrounding tiles are not the same. This ...
-3
votes
0answers
92 views

Find number of numbers made with 1,2,3,4 such that same digits never lie together [on hold]

There is a particular sequence only uses the numbers 1, 2, 3, 4 and no two adjacent numbers are the same. Write a program that given n1 1s, n2 2s, n3 3s, n4 4s will output the number of such ...
0
votes
0answers
46 views

How to improve A* Algorithm where each child node costs marginally different

I have an A* algorithm with a heuristic to best guide the best path. The problem is that each node can have up to 240 children and each subsequent child also... So doing a breadth first approach is ...
2
votes
3answers
131 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
109 views

How are the tiles in WORDAMENT organized?

I'm trying to create a word game, just like WORDAMENT, in my spare time. In order to present a new round, I need to create a board with 16 letters organized in a 4*4 grid. Currently, I'm generating ...
16
votes
1answer
391 views

3d Packing algorithm for item's shipping

I've received a task to build a shipping estimative that suggests the best accomodation of goods on as few boxes as possible: There is a finite set of known retangular box sizes There are many ...
16
votes
5answers
4k views

Algorithms: How do I sum O(n) and O(nlog(n)) together?

I have the follow algorithm which finds duplicates and removes them: public static int numDuplicatesB(int[] arr) { Sort.mergesort(arr); int numDups = 0; for (int i = 1; i < arr.length; ...
-1
votes
0answers
43 views

“Introduction to algorithms” vs “Algorithms” [closed]

I'm sophomore. I want learn algorithms. "Introduction to algorithms - Cormen" vs "Algorithms - Sedgewick" Which book is better for read and understand? I need experienced people help. Thanks
0
votes
1answer
54 views

Finding common subsets in a list of sets

Let say I have a list of sets, defined like this (3 sets in this example) : A = [1, 2, 3, 4, 5] B = [4, 5, 6, 7, 8] C = [1, 2, 3, 4, 5, 6, 7, 8] Total number of elements defined in sets : 18 I'd ...
-4
votes
0answers
30 views

Questions regarding graph/2-d matrix traversals and shortest path [closed]

Many interview questions are about graph traversal and shortest paths. For example, you may be asked to find the shortest path from a point in the graph to another. In order to solve it, one would use ...
2
votes
1answer
64 views

Need help identifying a league scheduling algorithm

I am trying to create a sports league scheduler. I am having trouble identifying an algorithm to help me efficiently fill in each slot. Sample data to build the schedule would be: 10 teams Each ...
0
votes
1answer
65 views

How to decide in which language to write an algorithm that iterates through large amounts of data? [closed]

I am attempting to implement an algorithm that takes in a massive array of data, and iterates through each element in this array. For each element, it will either create an new array and put the ...
1
vote
1answer
71 views

Check word density within a document

Here is the situation: I have a Document(d) and a set of keywords (Set<String> keywords). I like to check the density of each words from set keywords with d. I have few solution but not really ...
0
votes
1answer
124 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 ...
1
vote
1answer
45 views

How to do “image shifting” faster?

I have a grayscale matrix (implemented as a simple array) to be shown on a display: line 1: | a | b | c | line 2: | d | e | f | a-f are grayscale values. This pattern has to be shifted by a ...
1
vote
2answers
147 views

Best practices for geolocation

We are writing a flight search engine. We want to pre-fill the departure airport for mobile users with the closest one to their location. To do that, our plan is to Find a list of airports with ...
1
vote
1answer
44 views

saving connectivity information in a nodes/edges network

I want to implement the A* algorithm. I have a network with Nodes and Edges, both are classes. Now, I am unsure how to approach the connectivity information. Should a node know which edges depart ...
0
votes
0answers
49 views

Algorithm recommendation for string classification [migrated]

I have numerous (hundreds to low-thousands) of pre-classified short strings of text, each string is just a few words long, some just a single word. The strings have been divided into a few dozen ...
2
votes
1answer
97 views

Find n nodes farthest away from each other

I'm looking for an algorithm that gives me the n nodes that are the farthest away from each other. Can this be accomplished relatively efficiently? To clarify my question: I think of the problem as ...
0
votes
0answers
20 views

selecting area in array and expanding it to surroundings

I'm currently solving an algorithmic problem, but english is not my native language and I'm running into the limits of my language abilities when searching for reasonable solution. The problem: I ...
0
votes
1answer
75 views

How can I approach creating an efficient algorithm for maximizing value with these specific constraints?

I'm having trouble coming up with an approach that isn't n^2 for this problem. Here's a contrived, simplified version I've come up with: Let's say you're a company that needs 4 employees to launch in ...
0
votes
2answers
104 views

Algorithm for figuring out the enemy flag's location in Stratego

I am currently programming a Stratego game in JavaScript, simply because I wanted to learn to use JavaScript while spending some time to keep my programming skills up to par. (My current work ...
0
votes
1answer
114 views

Calculate reachability of one point from another

I have an array which stores a set of positive x coordinates in sorted way, say arr={1, 4, 5, 9, 12, 45} etc. And I have a maximum distance k which I can go from one point to another point let ...
0
votes
0answers
16 views

solving a number theoretical problem [migrated]

In mathematics, the greatest common divisor (gcd), also known as the greatest common factor (gcf), highest common factor (hcf), or greatest common measure (gcm), of two or more integers (at least one ...
0
votes
1answer
239 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 ...
0
votes
1answer
54 views

Are there any known file dispensing algorithms?

I wish to know if there are any known algorithms for dispensing a list of files for a specified maximum directory size (disc size for example), while attempting to keep output directories size close ...
3
votes
2answers
390 views

NLP - Queries using semantic wildcards in full text searching, maybe with Lucene?

Let's say I have a big corpus (for example in english or an arbitrary language), and I want to perform some semantic search on it. For example I have the query: "Be careful: [art] armada of [sg] is ...
5
votes
5answers
4k views

Can we technically un-blur images?

Since there is an algorithm to blur images, so that part of it cannot be recognised, can we reverse the algorithm and unblur part of than image? Is there a program that already does that, is that ...
0
votes
3answers
103 views

An algorithm for finding converse duplicates of ordered pairs

Given an array of ordered pairs of values, is there a well-known algorithm to find converse duplicates? [Converse meaning the same values, but in the opposite order.] That is, given ...
4
votes
1answer
115 views

Understanding Boyer-Moore Algorithm

Edit: I've found the original publication. It seems to me that the original does not have a l′(i). But I could be wrong because the definition of rpr(i) is so obscure to me. I'm not sure how it makes ...
128
votes
14answers
6k views

Simple method for reliably detecting code in text?

GMail has this feature where it will warn you if you try to send an email that it thinks might have an attachment. Because GMail detected the string see the attached in the email, but no actual ...
1
vote
1answer
96 views

Is it possible to antialias existing lines, circles, text, etc. of a single color?

I want to manually antialias the output of GDI drawing functions on Windows. Each drawing function is rendered onto its own image and then blitted back (so alpha blending can work, as GDI doesn't do ...
0
votes
1answer
100 views

Permutation tests for large sequences

I would like to perform a permutation test on a particularly large data set, i.e. around 4 million entries. Basically, I need to get some number of random permutations of this data set. Usual way to ...
3
votes
1answer
300 views

Accuracy of “calculator algorithms”

I am building a library class that provides functionality for mathematical operations on BigDecimals (and a few on BigIntegers). Now, BigIntegers are quite easy to master and pleasant to use. ...
0
votes
3answers
140 views

The right algorithm to get perfect combination

I am working on a self-study project but I cannot come up with a reliable answer. Here is the deal: I start with 500cm sticks. I have orders from customers who want smaller sticks. I am willing to ...
2
votes
1answer
123 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, ...
1
vote
1answer
41 views

Create a collection with “average points” of N items from a pool with items of various points

Let's say I have a question pool to generate exams out of it. Each question contains a difficulty from 1 (hard) to 99 (easy). The questions are available in a hash / array (adapt to your favorite ...
3
votes
1answer
59 views

Derive subset with sum between two values

I have a set S of size n whose members each have associated with them a number in the range 0.00 to 1.00 inclusive. I want to select a subset T of size m with this property: the average of the ...
2
votes
3answers
80 views

recalculation model for GUIs

I often come across this problem. Say to have a form with some controls: A B C = A + B D E = C * 2 ONLY IF D==TRUE F G = A - F The user fills A, then B. The system calculates C. The user fills D ...
0
votes
2answers
56 views

Algorithm for mapping users to a schedule based on time availability

I have a project where I must map employees to a schedule. The basic concept is: Company Opens between 08:30 and 17:00. Employee 1 can work from 08:30 to 12:00 then from 13:00 to 1700; Employee 2 ...
-1
votes
0answers
58 views

Best algorithm to schedule events

I have a data set of talks to be given at a event which is given by the user. It is assumed that talks are always ending on time and there are two parallel events at the same time. Both start at the ...
1
vote
1answer
91 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 ...