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

c_graph_parser do not calculate centrality with linear graph of 36 nodes #23

Closed
gabri94 opened this issue Aug 28, 2017 · 2 comments
Closed
Labels

Comments

@gabri94
Copy link
Member

gabri94 commented Aug 28, 2017

When calculating the centrality of a 36 nodes linear graph, the centrality appear to be "nan" for all the nodes except the first and the last one.
I think that somewhere in c_graph_parser a division by 0 occurs.
netjson of the graph:
{"type": "NetworkGraph", "protocol": "olsrv2", "version": "poprouting custom", "revision": "0.11.3", "metric": "ff_dat_metric", "router_id": "h31_31", "nodes": [{"id": "h4_4"}, {"id": "h28_28"}, {"id": "h24_24"}, {"id": "h25_25"}, {"id": "h3_3"}, {"id": "h33_33"}, {"id": "h30_30"}, {"id": "h5_5"}, {"id": "h29_29"}, {"id": "h0_0"}, {"id": "h23_23"}, {"id": "h7_7"}, {"id": "h14_14"}, {"id": "h6_6"}, {"id": "h2_2"}, {"id": "h1_1"}, {"id": "h21_21"}, {"id": "h11_11"}, {"id": "h34_34"}, {"id": "h18_18"}, {"id": "h32_32"}, {"id": "h31_31"}, {"id": "h20_20"}, {"id": "h15_15"}, {"id": "h16_16"}, {"id": "h22_22"}, {"id": "h8_8"}, {"id": "h12_12"}, {"id": "h26_26"}, {"id": "h17_17"}, {"id": "h9_9"}, {"id": "h27_27"}, {"id": "h19_19"}, {"id": "h10_10"}, {"id": "h13_13"}, {"id": "h35_35"}], "links": [{"source": "h4_4", "cost": 1.0, "target": "h5_5"}, {"source": "h4_4", "cost": 1.0, "target": "h3_3"}, {"source": "h28_28", "cost": 1.0, "target": "h29_29"}, {"source": "h28_28", "cost": 1.0, "target": "h27_27"}, {"source": "h24_24", "cost": 1.0, "target": "h25_25"}, {"source": "h24_24", "cost": 1.0, "target": "h23_23"}, {"source": "h25_25", "cost": 1.0, "target": "h26_26"}, {"source": "h3_3", "cost": 1.0, "target": "h2_2"}, {"source": "h33_33", "cost": 1.0, "target": "h34_34"}, {"source": "h33_33", "cost": 1.0, "target": "h32_32"}, {"source": "h30_30", "cost": 1.0, "target": "h29_29"}, {"source": "h30_30", "cost": 1.0, "target": "h31_31"}, {"source": "h5_5", "cost": 1.0, "target": "h6_6"}, {"source": "h0_0", "cost": 1.0, "target": "h1_1"}, {"source": "h23_23", "cost": 1.0, "target": "h22_22"}, {"source": "h7_7", "cost": 1.0, "target": "h8_8"}, {"source": "h7_7", "cost": 1.0, "target": "h6_6"}, {"source": "h14_14", "cost": 1.0, "target": "h13_13"}, {"source": "h14_14", "cost": 1.0, "target": "h15_15"}, {"source": "h2_2", "cost": 1.0, "target": "h1_1"}, {"source": "h21_21", "cost": 1.0, "target": "h20_20"}, {"source": "h21_21", "cost": 1.0, "target": "h22_22"}, {"source": "h11_11", "cost": 1.0, "target": "h12_12"}, {"source": "h11_11", "cost": 1.0, "target": "h10_10"}, {"source": "h34_34", "cost": 1.0, "target": "h35_35"}, {"source": "h18_18", "cost": 1.0, "target": "h17_17"}, {"source": "h18_18", "cost": 1.0, "target": "h19_19"}, {"source": "h32_32", "cost": 1.0, "target": "h31_31"}, {"source": "h20_20", "cost": 1.0, "target": "h19_19"}, {"source": "h15_15", "cost": 1.0, "target": "h16_16"}, {"source": "h16_16", "cost": 1.0, "target": "h17_17"}, {"source": "h8_8", "cost": 1.0, "target": "h9_9"}, {"source": "h12_12", "cost": 1.0, "target": "h13_13"}, {"source": "h26_26", "cost": 1.0, "target": "h27_27"}, {"source": "h9_9", "cost": 1.0, "target": "h10_10"}]}

@gabri94 gabri94 added the bug label Aug 28, 2017
@gabri94
Copy link
Member Author

gabri94 commented Sep 26, 2017

{
  "type": "NetworkGraph",
  "protocol": "olsrv1",
  "version": "pre-0.9.7",
  "metric": "",
  "revision": "olsr.org - pre-0.9.7-git_3126ae15-hash_b723fbce0dad64eddbe85573f39bd5a0",
  "router_id": "10.0.4.1",
  "nodes": [
    {
      "id": "10.0.0.1"
    },
    {
      "id": "10.0.1.1",
      "local_addresses": [
        "10.0.1.2"
      ]
    },
    {
      "id": "10.0.2.1",
      "local_addresses": [
        "10.0.2.2"
      ]
    },
    {
      "id": "10.0.3.1",
      "local_addresses": [
        "10.0.3.2"
      ]
    },
    {
      "id": "10.0.4.1",
      "local_addresses": [
        "10.0.4.2"
      ]
    },
    {
      "id": "10.0.5.1",
      "local_addresses": [
        "10.0.5.2"
      ]
    },
    {
      "id": "10.0.6.1",
      "local_addresses": [
        "10.0.6.2"
      ]
    },
    {
      "id": "10.0.7.1",
      "local_addresses": [
        "10.0.7.2"
      ]
    },
    {
      "id": "10.0.8.1",
      "local_addresses": [
        "10.0.8.2"
      ]
    },
    {
      "id": "10.0.9.1",
      "local_addresses": [
        "10.0.9.2"
      ]
    },
    {
      "id": "10.0.10.1",
      "local_addresses": [
        "10.0.10.2"
      ]
    },
    {
      "id": "10.0.11.1",
      "local_addresses": [
        "10.0.11.2"
      ]
    },
    {
      "id": "10.0.12.1",
      "local_addresses": [
        "10.0.12.2"
      ]
    },
    {
      "id": "10.0.13.1",
      "local_addresses": [
        "10.0.13.2"
      ]
    },
    {
      "id": "10.0.14.1",
      "local_addresses": [
        "10.0.14.2"
      ]
    },
    {
      "id": "10.0.15.1",
      "local_addresses": [
        "10.0.15.2"
      ]
    },
    {
      "id": "10.0.16.1",
      "local_addresses": [
        "10.0.16.2"
      ]
    },
    {
      "id": "10.0.17.1",
      "local_addresses": [
        "10.0.17.2"
      ]
    },
    {
      "id": "10.0.18.1",
      "local_addresses": [
        "10.0.18.2"
      ]
    },
    {
      "id": "10.0.19.1",
      "local_addresses": [
        "10.0.19.2"
      ]
    },
    {
      "id": "10.0.20.1",
      "local_addresses": [
        "10.0.20.2"
      ]
    },
    {
      "id": "10.0.21.1",
      "local_addresses": [
        "10.0.21.2"
      ]
    },
    {
      "id": "10.0.22.1",
      "local_addresses": [
        "10.0.22.2"
      ]
    },
    {
      "id": "10.0.23.1",
      "local_addresses": [
        "10.0.23.2"
      ]
    },
    {
      "id": "10.0.24.1",
      "local_addresses": [
        "10.0.24.2"
      ]
    },
    {
      "id": "10.0.25.1",
      "local_addresses": [
        "10.0.25.2"
      ]
    },
    {
      "id": "10.0.26.1",
      "local_addresses": [
        "10.0.26.2"
      ]
    },
    {
      "id": "10.0.27.1",
      "local_addresses": [
        "10.0.27.2"
      ]
    },
    {
      "id": "10.0.28.1",
      "local_addresses": [
        "10.0.28.2"
      ]
    },
    {
      "id": "10.0.29.1",
      "local_addresses": [
        "10.0.29.2"
      ]
    },
    {
      "id": "10.0.30.1",
      "local_addresses": [
        "10.0.30.2"
      ]
    },
    {
      "id": "10.0.31.1",
      "local_addresses": [
        "10.0.31.2"
      ]
    },
    {
      "id": "10.0.32.1",
      "local_addresses": [
        "10.0.32.2"
      ]
    },
    {
      "id": "10.0.33.1",
      "local_addresses": [
        "10.0.33.2"
      ]
    },
    {
      "id": "10.0.34.1",
      "local_addresses": [
        "10.0.34.2"
      ]
    },
    {
      "id": "10.0.35.1"
    }
  ],
  "links": [
    {
      "source": "10.0.4.2",
      "target": "10.0.3.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.3.1",
      "target": "10.0.4.2",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.4.1",
      "target": "10.0.5.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.5.1",
      "target": "10.0.4.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.0.1",
      "target": "10.0.1.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.1.1",
      "target": "10.0.0.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.1.1",
      "target": "10.0.2.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.2.1",
      "target": "10.0.1.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.2.1",
      "target": "10.0.3.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.3.1",
      "target": "10.0.2.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.3.1",
      "target": "10.0.4.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.5.1",
      "target": "10.0.4.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.5.1",
      "target": "10.0.6.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.6.1",
      "target": "10.0.5.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.6.1",
      "target": "10.0.7.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.7.1",
      "target": "10.0.6.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.7.1",
      "target": "10.0.8.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.8.1",
      "target": "10.0.7.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.8.1",
      "target": "10.0.9.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.9.1",
      "target": "10.0.8.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.9.1",
      "target": "10.0.10.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.10.1",
      "target": "10.0.9.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.10.1",
      "target": "10.0.11.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.11.1",
      "target": "10.0.10.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.11.1",
      "target": "10.0.12.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.12.1",
      "target": "10.0.11.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.12.1",
      "target": "10.0.13.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.13.1",
      "target": "10.0.12.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.13.1",
      "target": "10.0.14.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.14.1",
      "target": "10.0.13.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.14.1",
      "target": "10.0.15.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.15.1",
      "target": "10.0.14.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.15.1",
      "target": "10.0.16.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.16.1",
      "target": "10.0.15.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.16.1",
      "target": "10.0.17.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.17.1",
      "target": "10.0.16.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.17.1",
      "target": "10.0.18.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.18.1",
      "target": "10.0.17.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.18.1",
      "target": "10.0.19.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.19.1",
      "target": "10.0.18.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.19.1",
      "target": "10.0.20.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.20.1",
      "target": "10.0.19.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.20.1",
      "target": "10.0.21.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.21.1",
      "target": "10.0.20.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.21.1",
      "target": "10.0.22.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.22.1",
      "target": "10.0.21.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.22.1",
      "target": "10.0.23.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.23.1",
      "target": "10.0.22.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.23.1",
      "target": "10.0.24.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.24.1",
      "target": "10.0.23.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.24.1",
      "target": "10.0.25.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.25.1",
      "target": "10.0.24.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.25.1",
      "target": "10.0.26.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.26.1",
      "target": "10.0.25.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.26.1",
      "target": "10.0.27.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.27.1",
      "target": "10.0.26.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.27.1",
      "target": "10.0.28.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.28.1",
      "target": "10.0.27.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.28.1",
      "target": "10.0.29.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.29.1",
      "target": "10.0.28.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.29.1",
      "target": "10.0.30.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.30.1",
      "target": "10.0.29.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.30.1",
      "target": "10.0.31.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.31.1",
      "target": "10.0.30.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.31.1",
      "target": "10.0.32.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.32.1",
      "target": "10.0.31.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.32.1",
      "target": "10.0.33.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.33.1",
      "target": "10.0.32.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.33.1",
      "target": "10.0.34.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.34.1",
      "target": "10.0.33.1",
      "cost": 1,
      "cost_text": "1.000"
    },
    {
      "source": "10.0.34.1",
      "target": "10.0.35.1",
      "cost": 1,
      "cost_text": "6.396"
    },
    {
      "source": "10.0.35.1",
      "target": "10.0.34.1",
      "cost": 1,
      "cost_text": "10.160"
    }
  ]
}

@gabri94
Copy link
Member Author

gabri94 commented Sep 27, 2017

Solved by removing the symmetric edges while parsing the topology

@gabri94 gabri94 closed this as completed Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant