The graph crawling problem

Lax117614.GraphCrawlingProblem · concepts/Lax117614/GraphCrawlingProblem.lean · lax-117614

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    A crawl of a website graph is a set of pages containing a root page and every target page, each of its pages reachable from the root by hyperlinks inside the set; this is the node set of a rooted subtree, the crawl of Gauquier, Manolescu and Senellart (EDBT 2026). A website graph has a cheap crawl when it is finite and some crawl has at most as many pages as the marked set has elements, the budget. The graph crawling problem is the decision problem on website graphs whose yes-instances are the website graphs isomorphic to one with a cheap crawl.

    Concept map
    8 concepts; 5 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    In the paper

    • page 2 of this submission's paper

    Lean source view on GitHub

    1import Mathlib.SetTheory.Cardinal.Finite
    2import Mathlib.ModelTheory.Semantics
    3import Mathlib.Data.Set.Card
    4import Mathlib.Data.Set.Finite.Lemmas
    5import Lax904597.Classes
    6import Lax799700.Problems
    7import Lax117614.WebsiteGraphs
    8
    9/-!
    10---
    11title: The graph crawling problem
    12type: definition
    13---
    14A crawl of a website graph is a set of pages containing a root page and
    15every target page, each of its pages reachable from the root by hyperlinks
    16inside the set; this is the node set of a rooted subtree, the crawl of
    17Gauquier, Manolescu and Senellart (EDBT 2026). A website graph has a cheap
    18crawl when it is finite and some crawl has at most as many pages as the
    19marked set has elements, the budget. The graph crawling problem is the
    20decision problem on website graphs whose yes-instances are the website
    21graphs isomorphic to one with a cheap crawl.
    22-/
    23
    24namespace Lax117614.GraphCrawlingProblem
    25
    26open FirstOrder
    27
    28open FirstOrder.Language Structure
    29
    30open Lax904597.Problems Lax904597.Classes Lax799700.Problems Lax117614.WebsiteGraphs
    31
    32section Reachability
    33
    34variable {A : Type}
    35
    36/-- The directed step available inside a chosen set: an edge whose two
    37endpoints are both chosen. -/
    38def DiLink (Adjp : A → A → Prop) (S : A → Prop) (a b : A) : Prop :=
    39 S a ∧ S b ∧ Adjp a b
    40
    41/-- Every member of `S` is reachable from `r` by directed steps inside `S` –
    42the shape of an `r`-rooted subtree with node set `S`, reachability being all a
    43breadth-first traversal needs to assemble the tree. -/
    44def ReachesAllOn (Adjp : A → A → Prop) (r : A) (S : A → Prop) : Prop :=
    45 ∀ x, S x → Relation.ReflTransGen (DiLink Adjp S) r x
    46
    47end Reachability
    48
    49section Generic
    50
    51variable {A : Type}
    52
    53/-- Some marked root admits a crawl: a set of pages containing the root and
    54every target, entirely reachable from the root inside itself, of size (the
    55paper's total cost, at unit page costs) at most the number encoded by the
    56marked set. -/
    57def CrawlOn (Adjp : A → A → Prop) (Rp Tp Kp : A → Prop) : Prop :=
    58 ∃ r, Rp r ∧ ∃ S : A → Prop, S r ∧ (∀ x, Tp x → S x) ∧ ReachesAllOn Adjp r S ∧
    59 {x | S x}.ncard ≤ {x | Kp x}.ncard
    60
    61end Generic
    62
    63section Problem
    64
    65variable (A : Type) [siteGraph.Structure A]
    66
    67/-- A website graph admits a crawl within budget: a set of pages containing
    68the marked root and every target, reachable from the root inside itself, with
    69at most as many pages as the marked set has elements. (Finiteness of the
    70universe is part of the property: cardinality thresholds are only meaningful
    71on finite structures.) -/
    72def HasCheapCrawl : Prop :=
    73 Finite A ∧ CrawlOn (WSEdge (A := A)) WSRoot WSTarget WSMarked
    74
    75end Problem
    76
    77/-- GRAPH CRAWLING, decision variant at unit page costs: does the website
    78graph satisfy `HasCheapCrawl`? -/
    79def GraphCrawling : DecisionProblem siteGraph :=
    80 DecisionProblem.ofPred HasCheapCrawl
    81
    82end Lax117614.GraphCrawlingProblem
    83

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…