Skip to main content
. Author manuscript; available in PMC: 2021 Dec 3.
Published in final edited form as: IEEE/ACM Trans Comput Biol Bioinform. 2018 Apr 2;16(4):1168–1181. doi: 10.1109/TCBB.2018.2822280

Algorithm 2.

LAZYGREED for submodular maximization. [17]

1: Input: f and m matroid constraints Mi=(E,Ii).
2: Output: An approximation solution A^.
3: A^Ø; Initialize priority queue Q.
4: for vE do
5:  INSERT (Q,f(v))
6: end for
7: while Q not empty do
8: (v,a)POP(Q)
9: if ({v}A^)iIi then
10:   isFresh ← (α=f(vA^))
11:   if not isFresh then
12:    αf(vA^)
13:   end if
14:   if isFreash or α ≥ max(Q) then
15:    A^A^{v}
16:   else
17:    INSERT(Q, (v, α))
18:   end if
19: end if
20: end while
21: return A^