Questions tagged [algorithms]
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.
2,213 questions
1
vote
2
answers
87
views
Finding a subset of vertices in graph
I have a graph: undirected, unweighted, no leaves, no disconnected edges or vertices.
The graph is populated with vertices of 3 types: A, B, C.
Let's say, I hold a vertex of type A, denoted as A0.
I ...
0
votes
1
answer
158
views
Optimal way to avoid iterating through each row in a dictionary of data/arrays?
I have an excel macro that imports daily share price files, and finds the highest price for a share after a given date.
Each of these daily stock price files has ~1000 rows of data. Currently I have ...
-2
votes
3
answers
354
views
What is beyond ordinary c++, when trying to optimize a function?
Backstory:
Writing a QImage to Sixel renderer.
Feel like I have optimized it the best I can using basic c++.
I have heard suggestions here or there that you can utilize things like GPU, SIMD, insert ...
1
vote
1
answer
192
views
Data structure for grouping strings in a collection when they share common substrings [closed]
I am looking for a data structure and an algorithm to manage a dynamic collection of strings, but grouping strings that have a substring in common. I try to describe it through an example.
@Christophe:...
-2
votes
1
answer
204
views
algorithm needed for historical backups
I back up important paths from my PC each day with an automated process that creates zip files. On the 20 terabyte drive I can have close to three years worth. Each weekend I make a VHDX backup of my ...
0
votes
0
answers
80
views
approximating a shape with a line
I have an image that has been converted to an svg.
The conversion looks fine, but it has prefered to use fill instead of stroke.
This in itself is not a bad thing in terms of converting a raster image ...
0
votes
3
answers
197
views
Optimize reservation system algorithm
Im am developing a logistics application and at the moment, I try to solve the following problem:
In the system, there are multiple machines.
Each machine has one or more skills. For example, machine ...
2
votes
1
answer
734
views
Algorithm for finding all combinations with constraints
I'm looking for a way in C# that finds all the possible combinations with constraints.
I've got a list of machines. The machines have capabilities and limitations. I also have a document that defines ...
5
votes
9
answers
3k
views
Methods to increase the amount of data sent in a packet
I have been working on launching high-altitude balloons (HABs, or weather balloons) and I have been using LoRa to enable long-range communication with my balloons. It's been great and pretty reliable, ...
0
votes
1
answer
231
views
Match making algorithm respecting players' choices
I am currently developing an application in Python that has a match making functionality to form sports teams of 4 and group them by skill. The following has been implemented and works.
E.g.
Form ...
11
votes
4
answers
8k
views
Is there an algorithm for matchmaking?
I am interested to know if there is an existing algorithm to start a multiplayer game, for example, poker. What steps do we need to take when the player enters the "matchmaking phase"?
I ...
1
vote
2
answers
177
views
Culling edges from a triangulation while maintaining a connected graph?
I'm working on a small project and I'm randomly generating "world maps", with nodes you can fast travel to along given routes.
The basics of this aren't complicated; throw random points on a ...
3
votes
2
answers
294
views
Moving chunks of text until they stop colliding
I'm working on a component that needs to draw chart-like structures like this:
One issue I have is when multiple values are too close with each other. Here's an illustration:
The last values for the ...
2
votes
3
answers
160
views
Please help with this maze of fencepost problems ( vector across window )
I'm trying to implement LOGO with a physical turtle. I got all the basics done, but I got completely sunk when implementing the "Window" mode.
Original LOGO had 3 modes: "Border" - ...
3
votes
1
answer
508
views
Simulated Annealing
In relation to another question I had, I have been researching Simulated Annealing.
The general example used with this algorithm is the traveling salesman example. I have been testing the code ...
-1
votes
1
answer
187
views
Optimizing algorithm for categorizing pictures of Magic the Gathering Cards by type? [closed]
I'm making a piece of software that is able to recognize Magic the Gathering Cards from a picture or the actual camera.
The codebase scans for rectangular shapes (cards) in an image and calculates ...
-3
votes
1
answer
299
views
How to find the shortest common superstring [closed]
Problem statement:
You are given an array of strings. Each element (string) of array is of size 2. You are supposed to find the length of shortest possible string such that every element of the array ...
0
votes
3
answers
951
views
Mapping a range of values to a single value
So I have this problem where a specific ValuesA enum value is to be mapped to a respective ValuesB enum value, The trick is there can be multiple ValuesA mapping to a single ValuesB enum.
So for the ...
0
votes
1
answer
131
views
Multi dimensional lookups
I am looking to see if there is a general design pattern or strategy to handle a use case I see often in our codebases. My best attempt to generalize this use case is "Map permutations of n ...
-1
votes
2
answers
582
views
what algorithm does the malloc function in the c language standard library use? And why it so fast?
Based on the data structure of the AVL tree, I implemented a memory manager that does the best matching according to the size. I originally thought that the speed would be fast and the length of the ...
1
vote
1
answer
218
views
How do I narrow down a search space if symmetries are equivalent?
I have an algorithm that runs a search through every combination of a 5x5 grid where each cell can have 3 values, looking to see which combinations meet certain conditions. This gives 3^25 naive ...
30
votes
7
answers
17k
views
How can lossless compression ever exist?
If all data is essentially just a bit string, then all data can be represented as a number. Because a compression algorithm, c(x), must reduce or keep the same length of the input, then the compressed ...
2
votes
1
answer
187
views
can partial optimized Bozosort improve speed of sorting?
First of all, I am serious :)
You have array of N elements and we can compare them (e.g. operator > works).
Let's try to (unstable) sort it using following brand new sorting algorithm.
First, ...
0
votes
1
answer
215
views
Many if conditions
I have the code but I want to be pseudo as possible so I learn from other ways as much as possible.
So what I am building is web based tool and in one section we have a table.
This table renders lines ...
0
votes
1
answer
160
views
How to implement converters without needing to implement every permutation
I've got this class:
[UsedImplicitly]
public class ClassicalKeplerian
{
public ClassicalKeplerian(Angle argumentOfPeriapsis, Angle inclination, UnitFraction eccentricity, Angle ...