Skip to main content

All Questions

1 vote
1 answer
73 views

Generate superset with maximum overlap

I have a set $S$ with a total of 20000 items. I am also given a list $L$ of 0.5 million sets, with each set having 1-20 elements from the original set. I am given an integer $n$. Now I need a new set $...
Tarique's user avatar
  • 129
0 votes
1 answer
26 views

Choosing k elements with multiple weights maximizing the minimum weight

Consider the following optimisation problem. Given a set $S$ with $q$ weight functions $w_1, \ldots, w_q: S\rightarrow \mathbb{R}_+$ and a constant $1\leq k\leq |S|-1$. Find an $X\subset S, |X|=k$ ...
Bence's user avatar
  • 31
1 vote
1 answer
44 views

Find Number of unique durations that can be created given a list of durations and an upper bound

Lets say we are given a list of durations (5s, 10s, 10s, 15s, 15s, 15s, 25s, 30s....) and we want to find a list of unique durations that can be created using this list of single durations. for ...
Matay Mayrany's user avatar
0 votes
0 answers
21 views

Filtering out faulty durations

I have a question that is algorithms and CS related but felt more appropriate to ask on Math Exchange. I have a list of candidates, each with a given duration. for example {candidate1: 15s, candidate2:...
Matay Mayrany's user avatar
5 votes
1 answer
153 views

What are the chances that the Enemy/Defender game has a stable solution?

There is a game called Enemy/Defender that you might play with kids. The setup is as follows: Everyone stands in a circle. You say, "Look around the circle and select someone (at random) to be ...
Siddharth Desai's user avatar
4 votes
1 answer
283 views

Printing neatly

I'm working on the following problem (which is not my actual question) Consider the problem of neatly printing a paragraph with a monospaced font (all characters having the same width). The input ...
C.C.'s user avatar
  • 910
0 votes
1 answer
40 views

Is the stable marriage problem defined for $0$ people?

When proving properties of algorithms which are supposed to solve the stable marriage problem, I find myself unable to prove them sometimes in the case of there being $0$ things to pair with each ...
Princess Mia's user avatar
  • 2,979
1 vote
2 answers
71 views

Marching cubes generates surface triangles. How to adapt it to generate tetrahedra throughout the volume of a 3D model?

Background There is a source code that generates surface triangles. The isosurface is generated for the iso-value of 0. The source code uses a table for ...
Megidd's user avatar
  • 271
0 votes
0 answers
32 views

Effectively solve optimization problem in this system?

The system : Given $2$ sets $I,J$ such that $I\cap J = \emptyset , \#I = \#J$ a time-dependent function $c : \mathbb{R}_{\ge 0} \times I \times J \to \mathbb{R}_{\ge 0}$ . Consider a system that ...
C.C.'s user avatar
  • 910
1 vote
0 answers
73 views

How to quickly eyeball maximum sum subarray?

Given an integer array, I want to find the continuous subarray (containing at least one number) which has the largest sum. There are some algorithmic solutions to this here: https://en.wikipedia.org/...
Emperor Concerto's user avatar
0 votes
0 answers
68 views

Finding the general formula for the last standing soldier

Suppose there are 'n' soldiers standing in a circle who have decided to kill each other (just because they don't want to surrender to the opposition). Lets say they are denoted from a1 to an in the ...
VaiMan's user avatar
  • 1
8 votes
0 answers
317 views

Efficient algorithms to determine whether vertices form a deadlock

$\textbf{I. Problem Statements}$ Let $m, n \in \mathbb{N}^*$ and $G = (V, E)$ be a simple graph. First we define some notations: (1)$[m] := \{1, 2, \dots, m\}$. (2)$e_i$ is the elementary vector with $...
Muses_China's user avatar
  • 1,008
3 votes
2 answers
1k views

Why do greedy coloring algorithms mess up?

It is a well-known fact that, for a graph, the greedy coloring algorithm does not always return the most optimal coloring. That is, it strongly depends on the ordering of the vertices as they are ...
algebroo's user avatar
  • 737
0 votes
1 answer
63 views

Determining all possible values of $n$ in terms of $x$ of the following tree.

Let $T$ be a maximal heap tree. Let $T$ hold the integers $1$ to $n$ as its nodes without duplicates. Let $x$ be a child of the root. What are the possible values that $n$ could take, in terms of $x$? ...
user7828's user avatar
0 votes
0 answers
67 views

Greedy algorithm for variation of bin packing

Consider the bin packing problem where an input array of weights have to be packed in the minimum number of bins possible. Consider the two following restrictions. First, for any bin, a heavier weight ...
Rob32409's user avatar
  • 127

15 30 50 per page