diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3989050 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + tags: + - v*.*.* + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v3 + - uses: pdm-project/setup-pdm@v3 + - name: Publish package distributions to PyPI + run: pdm publish + + release: + name: Create Github release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true diff --git a/algobattle_problems/biclique/algobattle.toml b/algobattle_problems/biclique/algobattle.toml new file mode 100644 index 0000000..08878e5 --- /dev/null +++ b/algobattle_problems/biclique/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Bipartite Clique" + +[problems."Bipartite Clique"] +location = "problem.py" diff --git a/algobattle_problems/c4subgraphiso/algobattle.toml b/algobattle_problems/c4subgraphiso/algobattle.toml new file mode 100644 index 0000000..1de2368 --- /dev/null +++ b/algobattle_problems/c4subgraphiso/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Square Subgraph Isomorphism" + +[problems."Square Subgraph Isomorphism"] +location = "problem.py" diff --git a/algobattle_problems/clusterediting/algobattle.toml b/algobattle_problems/clusterediting/algobattle.toml new file mode 100644 index 0000000..bdd5274 --- /dev/null +++ b/algobattle_problems/clusterediting/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Cluster Editing" + +[problems."Cluster Editing"] +location = "problem.py" diff --git a/algobattle_problems/domset/algobattle.toml b/algobattle_problems/domset/algobattle.toml new file mode 100644 index 0000000..2d774d4 --- /dev/null +++ b/algobattle_problems/domset/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Dominating Set" + +[problems."Dominating Set"] +location = "problem.py" diff --git a/algobattle_problems/hikers/algobattle.toml b/algobattle_problems/hikers/algobattle.toml new file mode 100644 index 0000000..5afd713 --- /dev/null +++ b/algobattle_problems/hikers/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Hikers" + +[problems.Hikers] +location = "problem.py" diff --git a/algobattle_problems/longestpathboundedfvs/algobattle.toml b/algobattle_problems/longestpathboundedfvs/algobattle.toml new file mode 100644 index 0000000..3e25304 --- /dev/null +++ b/algobattle_problems/longestpathboundedfvs/algobattle.toml @@ -0,0 +1,8 @@ +[match] +problem = "Longest Path with Bounded Feedback Vertex Set" + +[problems."Longest Path with Bounded Feedback Vertex Set"] +location = "problem.py" +dependencies = [ + "networkx", +] diff --git a/algobattle_problems/longestpathboundedfvs/problem.py b/algobattle_problems/longestpathboundedfvs/problem.py index 8cc5b17..b694ded 100644 --- a/algobattle_problems/longestpathboundedfvs/problem.py +++ b/algobattle_problems/longestpathboundedfvs/problem.py @@ -48,7 +48,7 @@ def validate_solution(self, instance: Instance, role: Role) -> None: if not self._no_revisited_nodes(): raise ValidationError("The given path contains repeated nodes.") - def _nodes_are_walk(self, instance) -> bool: + def _nodes_are_walk(self, instance: Instance) -> bool: edge_set = set(instance.edges) g = Graph() for edge in edge_set: diff --git a/algobattle_problems/oscm3/algobattle.toml b/algobattle_problems/oscm3/algobattle.toml new file mode 100644 index 0000000..603971e --- /dev/null +++ b/algobattle_problems/oscm3/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "One-Sided Crossing Minimization-3" + +[problems."One-Sided Crossing Minimization-3"] +location = "problem.py" diff --git a/algobattle_problems/pairsum/algobattle.toml b/algobattle_problems/pairsum/algobattle.toml new file mode 100644 index 0000000..673c957 --- /dev/null +++ b/algobattle_problems/pairsum/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Pairsum" + +[problems.Pairsum] +location = "problem.py" diff --git a/algobattle_problems/pathpacking/algobattle.toml b/algobattle_problems/pathpacking/algobattle.toml new file mode 100644 index 0000000..b063475 --- /dev/null +++ b/algobattle_problems/pathpacking/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "P_3 Path Packing" + +[problems."P_3 Path Packing"] +location = "problem.py" diff --git a/algobattle_problems/scheduling/algobattle.toml b/algobattle_problems/scheduling/algobattle.toml new file mode 100644 index 0000000..300ed58 --- /dev/null +++ b/algobattle_problems/scheduling/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Job Shop Scheduling" + +[problems."Job Shop Scheduling"] +location = "problem.py" diff --git a/algobattle_problems/tsptimewindows/algobattle.toml b/algobattle_problems/tsptimewindows/algobattle.toml new file mode 100644 index 0000000..c3f084b --- /dev/null +++ b/algobattle_problems/tsptimewindows/algobattle.toml @@ -0,0 +1,5 @@ +[match] +problem = "Traveling Salesman with Time Windows" + +[problems."Traveling Salesman with Time Windows"] +location = "problem.py" diff --git a/pyproject.toml b/pyproject.toml index 1e5eee1..999d0ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,25 +5,22 @@ requires-python = ">=3.11" license = {text = "MIT"} authors = [{name = "Imogen Hergeth"}, {name = "Jan Dreier"}, {name = "Henri Lotze"}] dependencies = [ - "algobattle", + "algobattle-base~=4.0.0rc3", "networkx", ] [project.entry-points."algobattle.problem"] -Biclique = "algobattle_problems.biclique.problem:Biclique" -C4subgraphiso = "algobattle_problems.c4subgraphiso.problem:C4subgraphiso" -Clusterediting = "algobattle_problems.clusterediting.problem:Clusterediting" -Domset = "algobattle_problems.domset.problem:Domset" +"Bipartite Clique" = "algobattle_problems.biclique.problem:Biclique" +"Square Subgraph Isomorphism" = "algobattle_problems.c4subgraphiso.problem:C4subgraphiso" +"Cluster Editing" = "algobattle_problems.clusterediting.problem:Clusterediting" +"Dominating Set" = "algobattle_problems.domset.problem:Domset" Hikers = "algobattle_problems.hikers.problem:Hikers" -LPBFVS = "algobattle_problems.longestpathboundedfvs.problem:Longestpathboundedfvs" -OSCM3 = "algobattle_problems.oscm3.problem:OSCM3" +"Longest Path with Bounded Feedback Vertex Set" = "algobattle_problems.longestpathboundedfvs.problem:Longestpathboundedfvs" +"One-Sided Crossing Minimization-3" = "algobattle_problems.oscm3.problem:OSCM3" Pairsum = "algobattle_problems.pairsum.problem:Pairsum" -Pathpacking = "algobattle_problems.pathpacking.problem:Pathpacking" -Scheduling = "algobattle_problems.scheduling.problem:Scheduling" -Tsptimewindows = "algobattle_problems.tsptimewindows.problem:Tsptimewindows" - -[tool.setuptools.package-data] -algobattle_problems = ["*/generator/**/*", "*/solver/**/*"] +"P_3 Path Packing" = "algobattle_problems.pathpacking.problem:Pathpacking" +"Job Shop Scheduling" = "algobattle_problems.scheduling.problem:Scheduling" +"Traveling Salesman with Time Windows" = "algobattle_problems.tsptimewindows.problem:Tsptimewindows" [tool.pyright] diagnosticMode = "workspace"