This code is a C++ program built on Visual Studio 2022 17.4.4.
Operating System: Windows
Compiler: MSVC 14.34, igraph C library 0.9.9 (https://igraph.org/c/html/0.9.9/)
<exe_path> <csv_path> <object_flag> <alpha> <recursive> <loop>
exe_path
: The path of the executable file built from the source code. The fileeo.exe
can be directly used.csv_path
: The path of the CSV file that records the adjacency matrix of a network. Given a 3-node network, the content in the CSV file should be like:
0,1,1
1,0,1
1,1,0
object_flag
: A binary variable decides the optimization target, 0 for modularity-based optimization, 1 for in-block nestedness-based optimization.alpha
: The parameter α in the process of extremal optimization. If the optimized value is not improved inα*N
steps(N-the number of nodes), the optimization process will stop.recursive
: The number of times the whole network will be recursively partitioned. In the first recursion, the whole network will be split into two partitions. In the second recursion, each partition will be split into two smaller partitions.loop
: The number of times the code will run, corresponding to the number of optimized values/partitions.
The optimized results will be saved in a CSV file named by the above input parameters, stored in csv_path
.
- For modularity-based optimization(
object_flag = 0
), the results should be like:
<Q1>
<R1>
<C1>
<T1>
<Q2>
<R2>
<C2>
<T2>
...
Qx
: The optimized modularity in the xth loop.
Rx
: The block index of each row node(country, company, etc.), in the xth loop.
Cx
: The block index of each col node(product, technology, etc.), in the xth loop.
Tx
: The running time of the xth loop.
- For in-block nestedness-based optimization(
object_flag = 1
), the results should be like:
<N>
<I1>
<R1>
<C1>
<T1>
<I2>
<R2>
<C2>
<T2>
...
N
: The value of global nestedness.
Ix
: The optimized in-block nestedness in the xth loop.
Rx
: The block index of each row node(country, company, etc.), in the xth loop.
Cx
: The block index of each col node(product, technology, etc.), in the xth loop.
Tx
: The running time of the xth loop.
By computing the ratio N/Ix
, we can determine whether nesting is a local or global attribute.
C:\Users\Administrator\eo_ibn
│ eo.exe
│ matrix.csv
C:\Users\Administrator>cd eo_ibn
C:\Users\Administrator\eo_ibn>eo.exe matrix.csv 1 0.5 3 3
C:\Users\Administrator\eo_ibn
│ eo.exe
│ matrix.csv
│ matrix_0.5_3_ibn.txt
In matrix_0.5_3_ibn.txt
0.07878
0.129972
1, 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