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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ tarpaulin-report.html

# Reference packages (downloaded for comparison)
pkgref/

# Generated example outputs
docs/paper/examples/
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for problemreductions

.PHONY: help build test fmt clippy doc mdbook paper clean coverage rust-export compare qubo-testdata
.PHONY: help build test fmt clippy doc mdbook paper examples clean coverage rust-export compare qubo-testdata

# Default target
help:
Expand All @@ -18,6 +18,7 @@ help:
@echo " check - Quick check (fmt + clippy + test)"
@echo " rust-export - Generate Rust mapping JSON exports"
@echo " compare - Generate and compare Rust mapping exports"
@echo " examples - Generate example JSON for paper"
@echo " qubo-testdata - Regenerate QUBO test data (requires uv)"

# Build the project
Expand Down Expand Up @@ -48,8 +49,18 @@ doc:
mdbook:
mdbook serve docs --open

# Build Typst paper
paper:
# Generate all example JSON files for the paper
REDUCTION_EXAMPLES := $(patsubst examples/%.rs,%,$(wildcard examples/reduction_*.rs))
examples:
@mkdir -p docs/paper/examples
@for example in $(REDUCTION_EXAMPLES); do \
echo "Running $$example..."; \
cargo run --all-features --example $$example || exit 1; \
done
cargo run --all-features --example export_petersen_mapping

# Build Typst paper (generates examples first)
paper: examples
cargo run --example export_graph
cd docs/paper && typst compile reductions.typ reductions.pdf

Expand Down
52 changes: 26 additions & 26 deletions docs/paper/reduction_graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,37 +418,37 @@
},
{
"source": {
"name": "Satisfiability",
"name": "MaxCut",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
}
},
"target": {
"name": "DominatingSet",
"name": "SpinGlass",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
}
},
"bidirectional": false
"bidirectional": true
},
{
"source": {
"name": "Satisfiability",
"name": "QUBO",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
"weight": "f64"
}
},
"target": {
"name": "IndependentSet",
"name": "SpinGlass",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
"weight": "f64"
}
},
"bidirectional": false
"bidirectional": true
},
{
"source": {
Expand All @@ -459,10 +459,10 @@
}
},
"target": {
"name": "KColoring",
"name": "DominatingSet",
"variant": {
"graph": "SimpleGraph",
"weight": "i32"
"weight": "Unweighted"
}
},
"bidirectional": false
Expand All @@ -476,58 +476,58 @@
}
},
"target": {
"name": "KSatisfiability",
"name": "IndependentSet",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
}
},
"bidirectional": true
"bidirectional": false
},
{
"source": {
"name": "SetPacking",
"name": "Satisfiability",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
}
},
"target": {
"name": "IndependentSet",
"name": "KColoring",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
"weight": "i32"
}
},
"bidirectional": true
"bidirectional": false
},
{
"source": {
"name": "SetPacking",
"name": "Satisfiability",
"variant": {
"graph": "SimpleGraph",
"weight": "i32"
"weight": "Unweighted"
}
},
"target": {
"name": "QUBO",
"name": "KSatisfiability",
"variant": {
"graph": "SimpleGraph",
"weight": "f64"
"weight": "Unweighted"
}
},
"bidirectional": false
"bidirectional": true
},
{
"source": {
"name": "SpinGlass",
"name": "SetPacking",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
}
},
"target": {
"name": "MaxCut",
"name": "IndependentSet",
"variant": {
"graph": "SimpleGraph",
"weight": "Unweighted"
Expand All @@ -537,10 +537,10 @@
},
{
"source": {
"name": "SpinGlass",
"name": "SetPacking",
"variant": {
"graph": "SimpleGraph",
"weight": "f64"
"weight": "i32"
}
},
"target": {
Expand All @@ -550,7 +550,7 @@
"weight": "f64"
}
},
"bidirectional": true
"bidirectional": false
},
{
"source": {
Expand Down
Loading