Skip to content

Triangular Fuzzy set #11048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 27, 2023
commit 4b39eae3008cae24d67e58f815c01accb5389481
4 changes: 3 additions & 1 deletion divide_and_conquer/graphcolor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections import defaultdict
from typing import dict, list


class Graph:
def __init__(self, subjects: list[str]) -> None:
"""
Expand Down Expand Up @@ -40,11 +41,11 @@ def graph_coloring(self) -> dict[str, int]:
available_colors.add(color_map[subject])
return color_map


def get_minimum_time_slots(self) -> int:
color_map = self.graph_coloring()
return max(color_map.values())


# Example usage
subjects = ["Math", "Physics", "Chemistry", "Biology"]
students = {
Expand All @@ -62,4 +63,5 @@ def get_minimum_time_slots(self) -> int:
# Example doctest for add_edge method
if __name__ == "__main__":
import doctest

doctest.testmod()