Papers
Topics
Authors
Recent
Search
2000 character limit reached

Greedy-First Algorithm Overview

Updated 20 November 2025
  • Greedy-First Algorithm is a paradigm that makes locally optimal selections in domains such as contextual bandits, online AdWords allocation, and parallel search.
  • It employs adaptive exploitation by triggering exploration or dual updates only when safety conditions or budget constraints demand, ensuring guarantees like O(log T) regret and 1/2-competitiveness.
  • Empirical studies show that constrained expansion and decoupled node evaluation in parallel search improve scalability and speedup while preserving near-optimal performance.

The term Greedy-First Algorithm denotes several distinct algorithmic paradigms across learning theory, combinatorial optimization, and parallel search. Notable instances include (a) an adaptive contextual bandit framework minimizing unnecessary exploration; (b) a primal–dual online algorithm for the AdWords allocation problem under the small-bid assumption; and (c) a family of constrained parallel best-first search methods enforcing optimality domain invariants. Although these usages share an embrace of “greedy” (locally optimal, maximally opportunistic) expansion or allocation when safe, they each embody distinct theoretical guarantees and mechanistic subtleties.

1. Greedy-First in Contextual Bandits

In the contextual bandit setting, “Greedy-First” refers to an algorithm that dynamically determines, from live observed data, whether to operate in a pure greedy (exploitation) mode or to invoke explicit exploration. This approach is formalized in "Mostly Exploration-Free Algorithms for Contextual Bandits" (Bastani et al., 2017).

Suppose at time tt a context vector XtRdX_t \in \mathbb{R}^d is observed and the learner must select an arm i[K]i \in [K], each associated with an unknown parameter βiRd\beta_i \in \mathbb{R}^d. The reward has linear form Yi,t=Xtβi+εi,tY_{i,t} = X_t^\top\beta_i + \varepsilon_{i,t} with εi,t\varepsilon_{i,t} subgaussian. The algorithm proceeds as follows:

  • Greedy Phase: At each tt, select the arm maximizing Xtβ^iX_t^\top\hat\beta_i (where β^i\hat\beta_i is the OLS estimator for arm ii).
  • Exploration Trigger: For each arm, maintain the sample covariance Λi,t=sSi,tXsXs\Lambda_{i,t} = \sum_{s \in S_{i,t}} X_s X_s^\top (where Si,tS_{i,t} is the index set of times when arm ii was chosen). If at any t>t0t > t_0, for some ii, λmin(Λi,t)<λ0t/4\lambda_{\min}(\Lambda_{i,t}) < \lambda_0 t/4, force a switch to an explicit exploration algorithm (e.g., OLS bandit).
  • Guarantee: Under mild conditions (specifically, if "covariate diversity" holds: E[XX1{Xu0}]λ0Id\mathbb{E}[X X^\top 1\{X^\top u \geq 0\}] \succeq \lambda_0 I_d u\forall u), the greedy phase persists almost surely and cumulative regret is O(logT)O(\log T). Otherwise, Greedy-First guarantees O(logT)O(\log T) regret with strictly less exploration than UCB or Thompson sampling (Bastani et al., 2017).

Simulations on synthetic and real data show Greedy-First matches or outperforms exploration-based methods in settings where greedy is rate-optimal and rapidly adapts when exploration is necessary. This formulation minimizes unnecessary exploration while retaining minimax optimality.

2. Greedy-First in Online AdWords Allocation

For the online AdWords allocation problem under adversarial order and the small-bid assumption, Greedy-First denotes a primal–dual algorithm that always allocates queries to the active advertiser with maximum feasible bid, maintaining dual feasibility at all times (Li, 2019).

Formulation:

  • Let UU denote the set of advertisers with budgets BuB_u. Each query vv arrives online with bids wuvw_{uv}.
  • On each arrival, assign vv to the feasible uu^* maximizing wuv(1αu)w_{u^* v} (1 - \alpha_{u^*}), where αu\alpha_u is a dual variable, 0 until exhaustion, then jumps to 1.
  • After each match, if advertiser uu^* is exhausted, set αu1\alpha_{u^*} \leftarrow 1.
  • This assignment strategy yields the pure greedy allocation under the small-bid assumption (maxu,vwuv/Bu0\max_{u,v} w_{uv}/B_u \rightarrow 0).
  • The algorithm achieves a competitive ratio of $1/2$ for the revenue objective, tight in the worst case. This ratio is proven via primal–dual analysis: the constructed dual is always feasible, and the sum of primal gains is at least half the dual value (Li, 2019).

A key point is that the algorithm remains fully greedy until budget exhaustion triggers a dual variable update, and the small-bid assumption ensures that no single query causes excessive “jump” in dual variables.

In parallel graph search, the “Greedy-First” style describes a class of constrained parallel greedy best-first search (GBFS) algorithms that enforce expansions only within a theoretically justified subset of the state space, specifically the Bench Transition System (BTS)—the set of all states that could be expanded by some sequential GBFS policy (Shimoda et al., 2024).

  • Constraint Enforcement: Expansion is allowed only for states ss satisfying satisfies(s) = \texttt{true} \Longleftrightarrow s \in \mathrm{BTS}</code>.</li><li><strong>TraditionalBottlenecks:</strong>Innaı¨veparallelizations,threadsmayidlewaitingforBTSpermittedstatesatthetopoftheopenlist,andallsuccessorsofanodearegeneratedandevaluatedmonolithicallystallingparallelprogress.</li><li><strong>DecoupledGenerationEvaluation(<ahref="https://www.emergentmind.com/topics/symmetrizedgradientestimatorsge"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">SGE</a>):</strong>TheSGEvariantsplitsnodeexpansionintotwostages:(a)asinglethreadgeneratesallsuccessors,placingthemintoanunevaluatedqueue;(b)anyidlethreadevaluates</code>.</li> <li><strong>Traditional Bottlenecks:</strong> In naïve parallelizations, threads may idle waiting for BTS-permitted states at the top of the open list, and all successors of a node are generated and evaluated monolithically—stalling parallel progress.</li> <li><strong>Decoupled Generation–Evaluation (<a href="https://www.emergentmind.com/topics/symmetrized-gradient-estimator-sge" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">SGE</a>):</strong> The SGE variant splits node expansion into two stages: (a) a single thread generates all successors, placing them into an unevaluated queue; (b) any idle thread evaluates hforthesechildren.Onceallsiblingsareevaluated,thebatchisatomicallyinsertedintotheopenlist,respectingtheBTSconstraint.</li><li><strong>EmpiricalOutcomes:</strong>SGEsignificantlyincreasesstateevaluationrates(by919 for these children. Once all siblings are evaluated, the batch is atomically inserted into the open list, respecting the BTS constraint.</li> <li><strong>Empirical Outcomes:</strong> SGE significantly increases state evaluation rates (by 9–19% for 4–16 threads compared to the prior best), reduces the number of states expanded, decreases search time (e.g., 33% faster at 16 threads), and almost doubles speedup over single-threaded baselines (achieving S_{16}\approx 11.0,neartheideal, near the ideal 16\timesscaling)(<ahref="/papers/2408.05682"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Shimodaetal.,2024</a>).</li><li><strong>Limitations:</strong>Inunconstrainedsettings,theoverheadofmaintainingsiblingrecordsandextraqueuesmayreduceefficiency;alternativeschedulingsareneededforlazyevaluationorothersearchparadigms.</li></ul><h2class=paperheadingid=theoreticalguaranteesandanalysis>4.TheoreticalGuaranteesandAnalysis</h2><p>TheGreedyFirstapproach,inallitsguises,ischaracterizedbyaggressiveexploitationconstrainedbyrigoroussafetychecksordualupdates.</p><ul><li><strong>Bandits:</strong>GreedyFirstachieves scaling) (<a href="/papers/2408.05682" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Shimoda et al., 2024</a>).</li> <li><strong>Limitations:</strong> In unconstrained settings, the overhead of maintaining sibling records and extra queues may reduce efficiency; alternative schedulings are needed for lazy evaluation or other search paradigms.</li> </ul> <h2 class='paper-heading' id='theoretical-guarantees-and-analysis'>4. Theoretical Guarantees and Analysis</h2> <p>The Greedy-First approach, in all its guises, is characterized by aggressive exploitation constrained by rigorous safety checks or dual updates.</p> <ul> <li><strong>Bandits:</strong> Greedy-First achieves O(\log T)cumulativeregretunderconditionsincludingboundedness,margin,andcovariatediversity(oraproblemdependentpositiveprobabilityotherwise)(<ahref="/papers/1704.09011"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Bastanietal.,2017</a>).</li><li><strong>AdWords:</strong>Theprimaldualconstructionensuresa cumulative regret under conditions including boundedness, margin, and covariate diversity (or a problem-dependent positive probability otherwise) (<a href="/papers/1704.09011" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Bastani et al., 2017</a>).</li> <li><strong>AdWords:</strong> The primal–dual construction ensures a 1/2competitiveratioinadversarialarrivalsunderthesmallbidassumption(<ahref="/papers/1910.14610"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Li,2019</a>).</li><li><strong>ParallelGBFS:</strong>SGErecoversnearlylinearspeedupunderreasonableassumptions,withexpansionorderconstrainedtomimicplausiblesequentialGBFStrajectories,avoidingpathologicalexpansionblowup(<ahref="/papers/2408.05682"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Shimodaetal.,2024</a>).</li></ul><p>Theseguaranteesunderscoretheconditionsproblemregularity,structuralinvariants,orbudgetarysmallnessunderwhichgreedyfirstdeploymentisalgorithmicallysound.</p><h2class=paperheadingid=algorithmicinstantiationsandpseudocodestructures>5.AlgorithmicInstantiationsandPseudocodeStructures</h2><p>TabulatedbelowarethecorestepsofGreedyFirstalgorithmsacrossthethreedomains:</p><divclass=overflowxautomaxwfullmy4><tableclass=tablebordercollapsewfullstyle=tablelayout:fixed><thead><tr><th>Domain</th><th>GreedyFirstMechanism</th><th>Exploration/ConstraintTrigger</th></tr></thead><tbody><tr><td><ahref="https://www.emergentmind.com/topics/contextualbandits"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">ContextualBandits</a></td><td>Playarmmaximizing-competitive ratio in adversarial arrivals under the small-bid assumption (<a href="/papers/1910.14610" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Li, 2019</a>).</li> <li><strong>Parallel GBFS:</strong> SGE recovers nearly linear speedup under reasonable assumptions, with expansion order constrained to mimic plausible sequential GBFS trajectories, avoiding pathological expansion blowup (<a href="/papers/2408.05682" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Shimoda et al., 2024</a>).</li> </ul> <p>These guarantees underscore the conditions—problem regularity, structural invariants, or budgetary smallness—under which greedy-first deployment is algorithmically sound.</p> <h2 class='paper-heading' id='algorithmic-instantiations-and-pseudocode-structures'>5. Algorithmic Instantiations and Pseudocode Structures</h2> <p>Tabulated below are the core steps of Greedy-First algorithms across the three domains:</p> <div class='overflow-x-auto max-w-full my-4'><table class='table border-collapse w-full' style='table-layout: fixed'><thead><tr> <th>Domain</th> <th>Greedy-First Mechanism</th> <th>Exploration/Constraint Trigger</th> </tr> </thead><tbody><tr> <td><a href="https://www.emergentmind.com/topics/contextual-bandits" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Contextual Bandits</a></td> <td>Play arm maximizing X_t^\top \hat\beta_i,updateOLS,monitorcovariance</td><td>Switchifeigenvalue, update OLS, monitor covariance</td> <td>Switch if eigenvalue \lambda_{\min}low</td></tr><tr><td>OnlineAdWords</td><td>Matchto low</td> </tr> <tr> <td>Online AdWords</td> <td>Match to umaximizing maximizing w_{uv}(1 - \alpha_u),, \alpha_u = 1onexhaustion</td><td>Budgetsfullyspent</td></tr><tr><td>ParallelGBFS(SGE)</td><td>ExpandBTSpermittednode,generate,queuesuccessors,multithreaded on exhaustion</td> <td>Budgets fully spent</td> </tr> <tr> <td>Parallel GBFS (SGE)</td> <td>Expand BTS-permitted node, generate, queue successors, multithreaded heval</td><td>Expansiononlyfor eval</td> <td>Expansion only for s \inBTS</td></tr></tbody></table></div><p>Theprecisepseudocodeforeachvariantfollowstherespectivedomainscomputationalconventions,withformalstepsasprovidedin(<ahref="/papers/1704.09011"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Bastanietal.,2017</a>,<ahref="/papers/1910.14610"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Li,2019</a>),and(<ahref="/papers/2408.05682"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">Shimodaetal.,2024</a>).</p><h2class=paperheadingid=limitationsandextensions>6.LimitationsandExtensions</h2><p>WhiletheGreedyFirstparadigmofferssignificantadvantagesintermsofcomputationalefficiencyandsimplicity,itissubjecttoseverallimitations:</p><ul><li><strong>ContextualBandits:</strong>Successdependson<ahref="https://www.emergentmind.com/topics/diversitybetarecall"title=""rel="nofollow"dataturbo="false"class="assistantlink"xdataxtooltip.raw="">diversity</a>incontextsequences;absentthis,forcedexplorationmaybenecessary.Theprecisecutoffforswitchingisparameterdependent.</li><li><strong>AdWords:</strong>The BTS</td> </tr> </tbody></table></div> <p>The precise pseudocode for each variant follows the respective domain’s computational conventions, with formal steps as provided in (<a href="/papers/1704.09011" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Bastani et al., 2017</a>, <a href="/papers/1910.14610" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Li, 2019</a>), and (<a href="/papers/2408.05682" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Shimoda et al., 2024</a>).</p> <h2 class='paper-heading' id='limitations-and-extensions'>6. Limitations and Extensions</h2> <p>While the Greedy-First paradigm offers significant advantages in terms of computational efficiency and simplicity, it is subject to several limitations:</p> <ul> <li><strong>Contextual Bandits:</strong> Success depends on <a href="https://www.emergentmind.com/topics/diversity-beta-recall" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">diversity</a> in context sequences; absent this, forced exploration may be necessary. The precise cutoff for switching is parameter-dependent.</li> <li><strong>AdWords:</strong> The 1/2$-competitive bound is tight; higher ratios require more sophisticated algorithms such as MSVV/Balance.
  • Parallel Search: Overhead from managing successor queues and sibling sets may hinder performance in unconstrained tasks or in the presence of lazy heuristics. Adapting the SGE idea to multi-heuristic, bidirectional, or domain factorization strategies remains an open avenue (Shimoda et al., 2024).

A plausible implication is that Greedy-First methods are optimally suited where structure or regularity makes greedy action safe, but may require augmentation or fallback in more adversarial, ill-behaved, or poorly-observed settings.

7. Context and Comparative Frameworks

The Greedy-First idiom crystallizes an approach across domains whereby maximally opportunistic (“greedy”) action is taken whenever safe, deferring costlier exploration, constraint checks, or evaluation until necessary. In contextual bandit literature, this challenges the notion that extensive forced exploration is always necessary. In online combinatorial optimization, it provides a simple, primal–dual justified baseline. In parallel search, it enables efficient utilization of multi-core hardware without sacrificing the invariants maintained by sequential search analogs.

Empirical results and theoretical analyses confirm its situational optimality. However, strict establishable ceilings on performance and the dependency on structural or statistical regularity delimit the practical applicability of Greedy-First, motivating ongoing research into adaptive and hybrid algorithms that interpolate between greedy exploitation and principled exploration or constraint enforcement (Bastani et al., 2017, Li, 2019, Shimoda et al., 2024).

Topic to Video (Beta)

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Greedy-First Algorithm.