igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Passability of nodes


From: Tamas Nepusz
Subject: Re: [igraph] Passability of nodes
Date: Mon, 26 Nov 2018 09:16:55 +0100

> Some of the nodes, i.e. barriers have varying passability. This means a 
> barrier can be e.g. impassable in upstream direction but passable in 
> downstream direction. Now, I'd like to calculated shortest distances/path 
> from one set of nodes to another set of nodes along the directed river 
> network, however, by also considering the passability of the barrier-nodes, 
> i.e. to consider that some barriers "break" the graph and are impassible but 
> only when approached from a specific direction. How could this be achieve 
> with the igraph library?

How about replacing each barrier node V with two nodes VA and VB?
Assuming that edges point downstream, you can then rewire the head of
all incoming edges of V to VA and the tails of all outgoing edges of V
to VB, then place an edge from VA to VB if V is passable in the
downstream direction, or from VB to VA if it is passable in the
upstream direction.

T.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]