Hello.
I'm a student in Japan, recently using graphillion.
I found that GraphSet.converters is strange in source code, and happens error.
import matplotlib.pyplot as plt
from graphillion import GraphSet
import graphillion.tutorial as tl
import random
import networkx as nx
CONST_H = 500
CONST_W = 500
N = int(input())
M = int(input())
# Graphの接続設定
G = [[] for i in range(N)]
for i in range(M):
while True:
a = random.randint(0, N - 1)
b = random.randint(0, N - 1)
if a != b:
break
G[a].append(b)
G[b].append(a)
# 位置の設定
P = [(random.uniform(-CONST_W, CONST_W), random.uniform(-CONST_H, CONST_H))
for i in range(N)]
GraphSet.converters['to_edges'] = nx.Graph
GraphSet.converters['to_graph'] = nx.Graph.edges()
graph = nx.Graph()
for i in range(N):
graph.add_node(i)
for i in range(N):
for j in range(len(G[i])):
graph.add_edge(i, G[i][j])
# 全体図の描画
# nx.draw_networkx(graph, pos=P)
# plt.show()
GraphSet.set_universe(graph)
This code arises error in "GraphSet.set_universe(graph)", which error represents
Traceback (most recent call last):
File "graph.py", line 30, in <module>
GraphSet.converters['to_graph'] = nx.Graph.edges()
TypeError: 'property' object is not callable
When I saw the source code about set_converters
2101, 2102, rows
Hello. I'm a student in Japan, recently using graphillion.
I found that GraphSet.converters is strange in source code, and happens error.
This code arises error in "GraphSet.set_universe(graph)", which error represents
When I saw the source code about set_converters 2101, 2102, rows
Is this correct? I think this source code made mistake about changing position in 'to_graph', 'to_edges'.
Thank you.