Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI (Linux)

on:
push:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI (macOS)

on:
push:
branches: [master, modern-treewidth]
pull_request:

jobs:
build-and-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Boost
run: brew install boost
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure

sanitizers:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Boost
run: brew install boost
- name: Configure with ASan/UBSan
run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTREEWIDTH_SANITIZE=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![build](https://github.com/smaniu/treewidth/actions/workflows/ci.yml/badge.svg)](https://github.com/smaniu/treewidth/actions/workflows/ci.yml)
[![tests](https://img.shields.io/github/actions/workflow/status/smaniu/treewidth/ci.yml?label=tests)](https://github.com/smaniu/treewidth/actions/workflows/ci.yml)
[![Linux](https://github.com/smaniu/treewidth/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/smaniu/treewidth/actions/workflows/ci-linux.yml)
[![macOS](https://github.com/smaniu/treewidth/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/smaniu/treewidth/actions/workflows/ci-macos.yml)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/smaniu/treewidth/master/LICENSE)

This repository contains the source code for evaluation of lower and upper bounds of the
Expand Down
2 changes: 1 addition & 1 deletion tests/graph_builders.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inline Graph grid(unsigned long rows, unsigned long cols) {
return g;
}

// Two triangles sharing vertex 2 — matches the CLI baseline graph whose
// Three triangles attached via vertex 2 — matches the CLI baseline graph whose
// per-method treewidth values are pinned as goldens.
inline Graph sample_two_triangles() {
Graph g;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Delta2D queries get_neighbours() for an already-removed node (assertion in a
// debug build, SIGSEGV under NDEBUG), and LBN/LBN+ drive the known-buggy CE
// contraction and the isolated-node get_neighbours UB. These paths are covered
// once those bugs are fixed. See CLAUDE.md.
// once those bugs are fixed.

static unsigned long upper_tw(Graph g) {
DegreePermutationStrategy s;
Expand Down
6 changes: 3 additions & 3 deletions tests/test_upper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ TEST_CASE("upper bound is exact on structured graphs (min-degree)") {
{ DegreePermutationStrategy s; REQUIRE(upper_tw(cycle(3), s) == 2); }
}

TEST_CASE("upper bound never exceeds n-1") {
TEST_CASE("upper bound never exceeds N-1 (N = number of nodes)") {
for (unsigned long n = 2; n <= 8; n++) {
DegreePermutationStrategy s;
REQUIRE(upper_tw(grid(n, 3), s) <= 3 * n - 1);
}
}

// Golden treewidth values (first line of the .dec output) pinned per method on
// the CLI baseline graph. Method 3 (MCS) pins current *buggy* behavior on
// purpose, as a regression anchor — see CLAUDE.md.
// the CLI baseline graph. Method 3 (MCS) pins current known-buggy behavior on
// purpose, as a regression anchor.
TEST_CASE("golden treewidth per method on the sample graph") {
{ DegreePermutationStrategy s; REQUIRE(upper_tw(sample_two_triangles(), s) == 2); }
{ FillInPermutationStrategy s; REQUIRE(upper_tw(sample_two_triangles(), s) == 2); }
Expand Down
Loading