problem with using a loaded graph (graphml)


I have a problems using a loaded graphml graph.

my graphml look like this:

<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns=";
  <key id="key0" for="node""ref" attr.type="long" />
  <key id="key1" for="edge""weight" attr.type="double" />
  <graph id="G" edgedefault="undirected" parse.nodeids="canonical"
parse.edgeids="canonical" parse.order="nodesfirst">
    <node id="n0">
      <data key="key0">0</data>
    <node id="n1">
      <data key="key0">1</data>
    <edge id="e0" source="n0" target="n1">
      <data key="key1">0.1</data>
    <edge id="e1" source="n0" target="n16">
      <data key="key1">1.08661</data>
    <edge id="e2" source="n0" target="n205">
      <data key="key1">1.17957</data>

// What I do
g_uDirG = Graph(directed=False)
eprop_ang_weight = g_uDirG.new_edge_property("float")
g_uDirG = load_graph(xml_filename)

// Prints about the loaded graph
Num of Nodes
Num of Edges
ref (vertex) (type: int64_t)
weight (edge) (type: long double)

// copy the edge weights
eprop_ang_weight = g_uDirG.edge_properties["weight"]

// run betweenness
graph_tool.centrality.betweenness(g_uDirG, vprop=vprop_betweenness,
weight=eprop_ang_weight , norm=False)

The problem is that I get '0' in the distances of shortest paths and I get
betweeness 'nan' for all vertices.

What am I missing?



No one is using graphml loader? :frowning:


Please be patient when asking questions.

I simply did not understand the problem you are having. I don't see why
it has anything to do with the graphml loader... Please provide a
minimal and complete working example where the problem can be seen, so
that I can have chance of understanding it.

Im sorry that felt a bit of pressure. I’ve been smashing my head all day with
no solution and because its a small community list I thought that a number
of people will have a solution.

I finally found the solution 6AM after I woke up from jet lag.

Thanks for all the help in any case