The topology is ignored when it is a Networkx topology
- Dominant language
- C++
- Stars
- 536
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
Hello :)
I want to integrate a new topology in an archipelago so that it can be updated every time an island is added, but Pygmo does not respect the configuration.
In the following code example, given the topology (G) with 4 nodes, I would like to see these 4 islands in the archipelago when I use "pg.free_form(G)".
# Creation network's topology
G = nx.DiGraph()
list_nodes = list(range(0,4))
edges = list(itertools.product(list_nodes, list_nodes))
final_edge_list = []
for edge in edges:
if edge[0] != edge[1]:
final_edge_list.append((edge[0], edge[1], {"weight": 1.0}))
G.add_nodes_from(list_nodes)
G.add_edges_from(final_edge_list)
pos = nx.spring_layout(G)
nx.draw_networkx(G, pos, with_labels=True, font_weight='bold')
labels = nx.get_edge_attributes(G, 'weight')
nx.draw_networkx_edge_labels(G, pos, edge_labels=labels)
# Using the topology in the archipelago
archi = pg.archipelago(algo = pg.de(), prob = pg.rosenbrock(10), pop_size = 20, seed = 32, t=pg.free_form(G))
# # But the archipelago didn't get any island
Number of islands: 0
Topology: Free form
Migration type: point-to-point
Migrant handling policy: preserve
Status: idle
Islands summaries:
Type Algo Prob Size Status
-----------------------------------
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Python API path exercised by pg.free_form(G) and the archipelago constructor in the supplied NetworkX reproduction. Run the example with a four-node directed graph and inspect the resulting island count; done means the archipelago contains four islands and preserves the topology configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100