Skip to main content

Algorithm of etc.

Project description

pyalgo-tools

pyalgo-tools is a collection of various algorithms.

Example ドント方式で議席数を計算

print(dhondt(100, [45, 12, 34]))
[50 13 37]

Example 指定した合計となる部分集合の列挙

ary = [2, 1, 4, 3, 2]
for subset in enum_sub(ary, 4):
    print(f"sum({subset}) = {sum(subset)}")
sum([2, 2]) = 4
sum([1, 3]) = 4
sum([4]) = 4

Example 2つの円の重なる面積

print(round(circle_overlap_area(0, 2, 1, 0, 1, 2), 4))
3.1416

Example 平面グラフ

import networkx as nx

g, pos = random_planar_graph(20, seed=1)
nx.draw(g, pos=pos)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyalgo_tools-0.1.5-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pyalgo_tools-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pyalgo_tools-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for pyalgo_tools-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 227cb63a913d6a0a0def621b72b65a8d0a9dd6fe03b20f20f52f720393e9fbf5
MD5 92139c1bff94ff892d2aa02930e138d6
BLAKE2b-256 24538979bf55d71dfeaa9f349e4b1f9dd854b185a16636ae23925f07a6a016f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page