[GRASS-dev] [GRASS GIS] #1780: v.net.centrality: betweenness centrality seems wrong

#1780: v.net.centrality: betweenness centrality seems wrong
------------------------------------------+---------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.net.centrality betweenness | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------------+---------------------------------
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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1780&gt;
GRASS GIS <http://grass.osgeo.org>

#1780: v.net.centrality: betweenness centrality seems wrong
------------------------------------------+---------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.net.centrality betweenness | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------------+---------------------------------

Comment(by mmetz):

Replying to [ticket:1780 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1780#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1780: v.net.centrality: betweenness centrality seems wrong
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: invalid | Keywords: v.net.centrality betweenness
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

  * status: new => closed
  * resolution: => invalid

Comment:

Replying to [comment:1 mmetz]:
> Replying to [ticket:1780 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 ? :wink:

Closing this bug as invalid.

Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1780#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1780: v.net.centrality: betweenness centrality seems wrong
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: invalid | Keywords: v.net.centrality betweenness
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:2 mlennert]:
> Replying to [comment:1 mmetz]:
> > Replying to [ticket:1780 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 ? :wink:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1780#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1780: v.net.centrality: betweenness centrality seems wrong
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: invalid | Keywords: v.net.centrality betweenness
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by mlennert):

Replying to [comment:3 mmetz]:
> Replying to [comment:2 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 ? :wink:
>
> 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1780#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>