Home > other >  The nx networkx. Adj_matrix for help
The nx networkx. Adj_matrix for help

Time:09-30

First of all, thank you for your help,
Problems described in the following figure
,
AttackGraph function is as follows:
Def attackGraph (G, vi, vj, add_link) :
Vi=STR (vi)
Vj=STR (vj)
If add_link:
G.a dd_edge (vi, vj)
G.a dd_edge (vj, vi)
G.e dges [vi, vj] [' weight ']=1.0
G.e dges [vj, vi] [' weight ']=1.0
Print (' add link STR (vi), STR (vj) ', vi, vj, we as_edge (vi, vj))
The else:
Self. Graph. G.r emove_edge (vi, vj)
Self. Graph. G.r emove_edge (vj, vi)

The problem, felt very meng, don't know what is the problem?
  • Related