Package 'kwb.graph'

Title: Functions Finding Connected Links in Directed Graphs
Description: Functions finding connected links in directed graphs.
Authors: Hauke Sonnenberg [aut, cre] (ORCID: <https://orcid.org/0000-0001-9134-2871>), Michael Rustler [ctb] (ORCID: <https://orcid.org/0000-0003-0647-7726>), KURAS [fnd], Kompetenzzentrum Wasser Berlin gGmbH (KWB) [cph]
Maintainer: Hauke Sonnenberg <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-05-29 09:19:05 UTC
Source: https://github.com/KWB-R/kwb.graph

Help Index


Example Network

Description

Example data describing a network of connected links

Usage

exampleNetwork(n_links = 30L, index = 1L)

Arguments

n_links

number of links that the network to be returned shall contain. If there is no network with the given number of links, a network that is slightly smaller or bigger is returned. Giving -1L here returns the biggest possible network that is stored in this package.

index

integer number to switch between different sub nets if more than one subset of the required size is available.

Value

data frame with (roughly) n_links observations of two variables. The variables us_node_id (upstream node ID) and ds_node_id (downstream node ID) define the connections between links. They are needed if the list of connected links upstream of each node is to be calculated by means of getConnectedLinks.


#' Get Connected Links (C Implementation)

Description

#' Get Connected Links (C Implementation)

Usage

getConnectedLinks.C(
  directLinks,
  resultSize = 60000,
  queueSize = 1024 * 1024,
  version = 1,
  dbg = FALSE
)

Arguments

directLinks

directLinks

resultSize

default: 60000

queueSize

default: 1024*1024

version

version of C implementation: 1,2 or 3 (default: 1)

dbg

default: FALSE

Value

get connected links with C implementation


Get Connected Links (R Implementation)

Description

Get Connected Links (R Implementation)

Usage

getConnectedLinks.R(directly.connected, dbg = FALSE)

Arguments

directly.connected

directly.connected

dbg

default: FALSE

Value

get connected links with R implementation


Get Direct Links (C Implementation)

Description

Get Direct Links (C Implementation)

Usage

getDirectLinks.C(x, MAX_DIRECT_CONNECTIONS = 5, dbg = FALSE)

Arguments

x

data frame with each row representing a link of the network. Required columns: us_node_id, ds_node_id

MAX_DIRECT_CONNECTIONS

default: 5

dbg

default: FALSE

Value

get direct links with C implementation


Get Direct Links (R Implementation)

Description

Get Direct Links (R Implementation)

Usage

getDirectLinks.R(x, upstream = TRUE)

Arguments

x

data frame with each row representing a link of the network. Required columns: us_node_id, ds_node_id

upstream

if TRUE (upstream), if FALSE (downstream), default: TRUE

Value

get direct links with R implementation