Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1780 closed defect (invalid)

v.net.centrality: betweenness centrality seems wrong

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Vector Version: svn-trunk
Keywords: v.net.centrality betweenness Cc:
CPU: Unspecified Platform: Unspecified

Description

v.net streets_wake points=schools_wake thresh=200 out=network op=connect v.net.centrality input=network alayer=1 nlayer=2 output=centrality cats=1-108 degree=degree closeness=closeness betweenness=betw eigenvector=eig

Only three nodes (36, 136, 138) have betweenness centrality above 0 which seems wrong.

I'll try to find another tool to calculate centrality values in order to have a reference.

Moritz

Change History (4)

comment:1 in reply to:  description ; Changed 8 years ago by mmetz

Replying to mlennert:

v.net streets_wake points=schools_wake thresh=200 out=network op=connect

v.net.centrality input=network alayer=1 nlayer=2 output=centrality cats=1-108 degree=degree closeness=closeness betweenness=betw eigenvector=eig

Only three nodes (36, 136, 138) have betweenness centrality above 0 which seems wrong.

I get six nodes (28, 94, 97, 136, 138, 154) with betweenness centrality > 0. For all other nodes, a betweenness centrality of 0 seems correct because they are located at end points of the network, i.e. not in between any two other nodes.

Markus M

comment:2 in reply to:  1 ; Changed 8 years ago by mlennert

Resolution: invalid
Status: newclosed

Replying to mmetz:

Replying to mlennert:

v.net streets_wake points=schools_wake thresh=200 out=network op=connect

v.net.centrality input=network alayer=1 nlayer=2 output=centrality cats=1-108 degree=degree closeness=closeness betweenness=betw eigenvector=eig

Only three nodes (36, 136, 138) have betweenness centrality above 0 which seems wrong.

I get six nodes (28, 94, 97, 136, 138, 154) with betweenness centrality > 0.

I can confirm these six nodes. Don't know what happened in the previous try.

For all other nodes, a betweenness centrality of 0 seems correct because they are located at end points of the network, i.e. not in between any two other nodes.

Ok, I see my error: since the schools are connected by short lines to the network, no shortest path between two other schools ever passes through those short lines and thus betweenness is 0. The only exception are those schools which are right next to another school and where the latter is connected to the network via the former. Then all shortest paths from the latter go through the former...

This raises the question of whether it would be envisageable / desirable to add an option to v.net allowing to create nodes _on_ the existing network when connecting new points, instead of connecting these points by short lines. IOW, instead of currently adding a short line from any point in the given threshold to the network, "just" create a new node on a point of the network that is closest to the point you wish to add. Am I being clear ? ;-)

Closing this bug as invalid.

Moritz

comment:3 in reply to:  2 ; Changed 8 years ago by mmetz

Replying to mlennert:

Replying to mmetz:

Replying to mlennert:

v.net streets_wake points=schools_wake thresh=200 out=network op=connect

v.net.centrality input=network alayer=1 nlayer=2 output=centrality cats=1-108 degree=degree closeness=closeness betweenness=betw eigenvector=eig

Ok, I see my error: since the schools are connected by short lines to the network, no shortest path between two other schools ever passes through those short lines and thus betweenness is 0. The only exception are those schools which are right next to another school and where the latter is connected to the network via the former. Then all shortest paths from the latter go through the former...

This raises the question of whether it would be envisageable / desirable to add an option to v.net allowing to create nodes _on_ the existing network when connecting new points, instead of connecting these points by short lines. IOW, instead of currently adding a short line from any point in the given threshold to the network, "just" create a new node on a point of the network that is closest to the point you wish to add. Am I being clear ? ;-)

Perfectly. Please try the new -s flag in r53665 for v.net to "Snap points to network". I think this makes sense for network preparation in general, particularly for features like schools, hospitals etc. that are represented by a point.

With the above test command, -s flag added, there are now only two points with a betweenness of 0.

Markus M

comment:4 in reply to:  3 Changed 8 years ago by mlennert

Replying to mmetz:

Replying to mlennert:

This raises the question of whether it would be envisageable / desirable to add an option to v.net allowing to create nodes _on_ the existing network when connecting new points, instead of connecting these points by short lines. IOW, instead of currently adding a short line from any point in the given threshold to the network, "just" create a new node on a point of the network that is closest to the point you wish to add. Am I being clear ? ;-)

Perfectly. Please try the new -s flag in r53665 for v.net to "Snap points to network". I think this makes sense for network preparation in general, particularly for features like schools, hospitals etc. that are represented by a point.

Thanks a lot, this is perfect ! I added a note to the man page about this flag.

Moritz

Note: See TracTickets for help on using tickets.