16 Commits
Author SHA1 Message Date
lighting9999pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
c4246f0ea0 Optimize Ford-Fulkerson algorithm with type annotations and performance improvements (#13128)
* change ford_fulkerson.py

* fix ford_fulkerson.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix typo for ford_fulkerson.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Change ford_fulkerson.py

* fix I001 Error for ford_fulkerson.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix ford_fulkerson.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-23 23:43:40 +02:00
BHUMIKA KADU✨kadubhumikapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
636dd57af7 Fix ty invalid assignment (#15222)
* Fix ty invalid assignment diagnostics

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix unused typing import

* Fix gradient accumulation type handling

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix automatic differentiation gradient dtype handling

---------

Co-authored-by: kadubhumika <kadubhumika@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-08 17:57:46 +02:00
priya-sundaram-dev 8e0817e829 Clean up the networking_flow directory (#15098)
* Clean up the networking_flow directory

- Add networking_flow/README.md covering max-flow / min-cut, with a
  file-by-file table and guidance on which algorithm to use.
- minimum_cut.py: add a module docstring with a Wikipedia URL, type
  hints, and corner-case doctests; work on a copy so the input graph is
  no longer mutated.
- Add dinic.py: Dinic's algorithm (BFS level graph + DFS blocking flow),
  adjacency-list based so it handles parallel edges and sparse graphs.
- Add push_relabel.py: the Goldberg-Tarjan push-relabel (preflow) method
  with highest-label selection.

Both new algorithms are fully type-hinted, documented with a Wikipedia
reference, and validated by doctests; their output was cross-checked
against ford_fulkerson.py on thousands of random graphs.

* Address review: drop __future__ import, use descriptive names, apply README wording
2026-08-28 00:39:49 +02:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> bc8df6de31 [pre-commit.ci] pre-commit autoupdate (#11322)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-13 07:52:41 +01:00
Hardik PawarChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
fd227d8026 Add function docstrings, comments and type hints (#10893)
* Add function docstrings, comments and type hints

* Fix type mismatch

* Fix type hint error

* Fix float to int error

* Update ford_fulkerson.py

* Update ford_fulkerson.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update ford_fulkerson.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-24 23:35:38 +02:00
Mark Mayo f32d611689 clean of unnecessary checks, imports, calls (#7993) 2022-11-21 00:00:27 +13:00
CaedenChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
07e991d553 Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062)
* ci(pre-commit): Add pep8-naming to `pre-commit` hooks (#7038)

* refactor: Fix naming conventions (#7038)

* Update arithmetic_analysis/lu_decomposition.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor(lu_decomposition): Replace `NDArray` with `ArrayLike` (#7038)

* chore: Fix naming conventions in doctests (#7038)

* fix: Temporarily disable project euler problem 104 (#7069)

* chore: Fix naming conventions in doctests (#7038)

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-13 00:54:20 +02:00
Dhruv 48357cea5b Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
Christian Claussandgithub-actions 1f8a21d727 Tighten up psf/black and flake8 (#2024)
* Tighten up psf/black and flake8

* Fix some tests

* Fix some E741

* Fix some E741

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-22 08:10:11 +02:00
Christian Clauss bfcb95b297 Create codespell.yml (#1698)
* fixup! Format Python code with psf/black push

* Create codespell.yml

* fixup! Format Python code with psf/black push
2020-01-18 13:24:33 +01:00
William Zhang 9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Christian Clauss dc2b575274 Add doctests to networking_flow/minimum_cut.py (#1126) 2019-08-13 11:59:49 +02:00
Alex Brown 91fccecb56 snake_case all the things 2018-10-19 17:14:25 -05:00
Sichen Liu e3a03c559e networking_flow 2018-03-08 15:53:10 -05:00
Sichen Liu 2f53847247 2018-03-08 15:52:16 -05:00
Sichen Liu ab5f262fc1 2018-03-08 12:58:38 -05:00