Skip to content
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

Total list-colouring fails sometimes #24

Open
MHenderson opened this issue Nov 29, 2024 · 1 comment
Open

Total list-colouring fails sometimes #24

MHenderson opened this issue Nov 29, 2024 · 1 comment

Comments

@MHenderson
Copy link
Owner

G = nx.complete_graph(3)

permissible_dict_edge = {(0, 1): [0, 1], (0, 2): [1, 2], (1, 2): [2, 4]}
nx.set_edge_attributes(G, permissible_dict_edge, "permissible")
nx.set_edge_attributes(G, None, "colour")
permissible_dict = {0: [0, 1], 1: [1, 2], 2: [2, 3]}
nx.set_node_attributes(G, permissible_dict, "permissible")
nx.set_node_attributes(G, None, "colour")

total_list_colouring_solution(G)
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-12-c35ef55e0995> in <cell line: 10>()
      8 nx.set_node_attributes(G, None, "colour")
      9 
---> 10 total_list_colouring_solution(G)

3 frames

/usr/local/lib/python3.10/dist-packages/constraint/__init__.py in getSolutionIter(self, domains, constraints, vconstraints)
    492                 for variable in domains
    493             ]
--> 494             lst.sort()
    495             for item in lst:
    496                 if item[-1] not in assignments:

TypeError: '<' not supported between instances of 'tuple' and 'int'
@MHenderson
Copy link
Owner Author

Probably has something to do with using a combination of tuples and integers as variables in constraints (but that works in other cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant