Skip to main content

Questions tagged [greedy-algorithms]

Questions about algorithms that make at each step the locally optimal choice.

1 vote
1 answer
108 views

I'm working on proving a greedy solution to the problem in Codeforces 205B, which states: Given an array of integers a of length ...
adult_learner's user avatar
3 votes
2 answers
240 views

Suppose we have a set $N$ of $n$ players and a set $M$ of $m$ items. We are given a matrix $P_{n \times m}$ whose element $p_{ij} \geq 0$ $(i \in N, m \in M)$ denotes the valuation of good $j$ by ...
cstheorist's user avatar
0 votes
0 answers
76 views

I am reading up on Graham's algorithm and want to prove it's $4/3 - 1/(3m)$ optimality. To do that, we need to prove that if $j$ is the last job assigned to the most heavily loaded machine in the ...
MangoPizza's user avatar
2 votes
1 answer
272 views

https://en.wikipedia.org/wiki/Hungarian_algorithm In the assignment problem as described above, the goal is to find an assignment that minimizes the total cost, and the Hungarian Algoirthm is a ...
Tom Davies's user avatar
0 votes
0 answers
36 views

I have a question related to the interval scheduling problem (greedy algorithm). When solving a typical interval scheduling problem using a greedy algorithm, we select intervals based on the earliest ...
justin003's user avatar
0 votes
0 answers
45 views

Essentially I have N bins of equal size in which I want to spread M objects of arbitrary-ish size as evenly as possible. Arbitrary-ish-size in that the largest object is much much smaller than any ...
francoposa's user avatar
2 votes
1 answer
113 views

This's exercise $7$ of chp $11$ from the popular book algorithm design by Jon and Eva. It's about designing a $2$-approximation algorithm for a problem similar to Load balancing on parallel machine. ...
C.C.'s user avatar
  • 225
1 vote
1 answer
131 views

Let $G=(V,E)$ a directed graph with weight function $w:E \to R$. let $s \in V$ a vertex s.t it has path to any other vertex in $G$. Suppose that every negative vertex in this graph is bridge edge, ...
csmathstudent8's user avatar
0 votes
0 answers
75 views

Problem Context I am working on solving the Minimum Feedback Vertex Set (MinFVS) problem on a 2D geometric graph. A geometric graph consists of vertices defined as points in a 2D plane, with edges ...
jonathan's user avatar
0 votes
0 answers
51 views

I'm working on a problem involving load balancing across three machines. I need to find an input example (a list of job sizes) where the greedy scheduling algorithm produces a strictly lower makespan ...
Seyed Moein Ayyoubzadeh's user avatar
1 vote
1 answer
156 views

Given an array of integers of size n, the task is to reduce the disturbance of the array where disturbance is counted as number of same neighbouring pairs. Ex: 2 1 2 2 1 1 The disturbance is 2. As ...
Biswanath's user avatar
2 votes
1 answer
567 views

I found an $O(n^2)$ accepted submission to LeetCode 1593, and I don't understand why it works. I have included the problem statement, my understanding of what the $O(n^2)$ code does, the submitted ...
R. Javid's user avatar
  • 173
0 votes
2 answers
224 views

I have tried writing an algorithm which will solve the problem: "Consider the set $X:= \{0,...,14\}$. Define the 'blocks' of $X$ to be the 4-element subsets of $X$. For each block, let all the ...
Fraser's user avatar
  • 1
0 votes
1 answer
146 views

I am solving a variation of the missing coin sum problem, modified to be as follows: You have n coins with positive integer values. What is the smallest sum greater than the minimum coin in the array ...
Arnav Borborah's user avatar
2 votes
0 answers
52 views

Given a non-decreasing sequence of $n$ positive integers $a_1 \leq a_2 \leq \dots \leq a_n$, we are allowed to modify this sequence by performing the following operation: we select two elements $a_i, ...
Adam's user avatar
  • 21

15 30 50 per page
1
2 3 4 5
31