Skip to content

RRD - Add burning_number and vertex_clique_cover_number#24

Merged
RandyRDavila merged 1 commit into
mainfrom
rrd-add-burning-number-and-clique-cover-number
Sep 4, 2025
Merged

RRD - Add burning_number and vertex_clique_cover_number#24
RandyRDavila merged 1 commit into
mainfrom
rrd-add-burning-number-and-clique-cover-number

Conversation

@RandyRDavila
Copy link
Copy Markdown
Owner

No description provided.

@RandyRDavila RandyRDavila requested a review from Copilot September 4, 2025 14:43
@RandyRDavila RandyRDavila changed the title RRD - Added burning number and clique cover number RRD - Add burning_number and vertex_clique_cover_number Sep 4, 2025
@RandyRDavila RandyRDavila added the enhancement New feature or request label Sep 4, 2025
@RandyRDavila RandyRDavila merged commit 9a7d6db into main Sep 4, 2025
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds two new graph invariants to the graphcalc library: the burning number and the vertex clique cover number. The burning number represents the minimum number of rounds needed to "burn" all vertices in a graph through a spreading process, while the vertex clique cover number determines the minimum number of cliques needed to partition all vertices.

  • Added burning number computation using Mixed Integer Programming with comprehensive test coverage
  • Added vertex clique cover number computation using the complement graph's chromatic number
  • Updated data generation to include both new invariants in knowledge tables

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/test_burning_number.py Comprehensive test suite for burning number on various graph families
src/graphcalc/invariants/zero_forcing.py Implementation of burning number using MIP with utilities and solver integration
src/graphcalc/invariants/classics.py Implementation of vertex clique cover functions and minor fix to coloring constraints
src/graphcalc/data/data_generation.py Added new invariants to the list of computed properties

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +3 to 9
from typing import Dict, Hashable, List, Optional, Tuple
import itertools
import math



from typing import Union, Set, List, Hashable
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate imports and inconsistent import organization. Lines 2-5 import typing components that are then re-imported on line 9. The typing imports should be consolidated into a single import statement.

Suggested change
from typing import Dict, Hashable, List, Optional, Tuple
import itertools
import math
from typing import Union, Set, List, Hashable
from typing import Dict, Hashable, List, Optional, Tuple, Union, Set
import itertools
import math

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +18
from graphcalc.utils import enforce_type, GraphLike
from graphcalc.core import SimpleGraph
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SimpleGraph is imported twice - once from graphcalc on line 16 and again from graphcalc.core on line 18. This creates redundant imports and potential confusion.

Suggested change
from graphcalc.utils import enforce_type, GraphLike
from graphcalc.core import SimpleGraph

Copilot uses AI. Check for mistakes.
Comment on lines +1291 to +1293
"""Shortest-path distances; disconnected pairs get +inf."""
dist: Dict[Hashable, Dict[Hashable, int]] = {
u: {v: (0 if u == v else math.inf) for v in G.nodes()} for u in G.nodes()
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using math.inf for disconnected pairs is inefficient as it creates float objects. Since these distances are later compared with integers, consider using a large integer constant instead, or handle disconnected pairs separately to avoid unnecessary float comparisons.

Suggested change
"""Shortest-path distances; disconnected pairs get +inf."""
dist: Dict[Hashable, Dict[Hashable, int]] = {
u: {v: (0 if u == v else math.inf) for v in G.nodes()} for u in G.nodes()
"""Shortest-path distances; disconnected pairs get a large integer value."""
LARGE_INT = 10**9
dist: Dict[Hashable, Dict[Hashable, int]] = {
u: {v: (0 if u == v else LARGE_INT) for v in G.nodes()} for u in G.nodes()

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
from typing import Set, Hashable, Dict, Tuple, Hashable
from typing import Set, Hashable, Dict, Tuple, Hashable, List
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type Hashable is imported twice in the same import statement. Remove the duplicate import.

Suggested change
from typing import Set, Hashable, Dict, Tuple, Hashable, List
from typing import Set, Hashable, Dict, Tuple, List

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants