Package 'HGraph'

Title: Use Graph Structure to Travel
Description: It is used to travel graphs, by using DFS and BFS to get the path from node to each leaf node. Depth first traversal(DFS) is a recursive algorithm for searching all the vertices of a graph or tree data structure. Traversal means visiting all the nodes of a graph. Breadth first traversal(BFS) algorithm is used to search a tree or graph data structure for a node that meets a set of criteria. It starts at the tree’s root or graph and searches/visits all nodes at the current depth level before moving on to the nodes at the next depth level. Also, it provides the matrix which is reachable between each node. Implement reference about Baruch Awerbuch (1985) <doi:10.1016/0020-0190(85)90083-3>.
Authors: JinanPang[aut, cre], HuiLi[ctb]
Maintainer: Jinan Pang <[email protected]>
License: GPL-2
Version: 0.1.0
Built: 2025-02-13 05:13:13 UTC
Source: https://github.com/cran/HGraph

Help Index


edge file to R

Description

A dataset Of edge

Usage

edge

Format

a:


Get travel path of graph

Description

Get travel path of graph

Usage

get_graph_info(edgeMatrix = HGraph::edge, varVec = c("a", "b", "c"))

Arguments

edgeMatrix

a matrix

varVec

a vector

Value

Graph struct

Examples

aedge <- matrix(0, 3, 3, dimnames=list(c("a", "b", "c"), c("a", "b", "c")))
aedge["a","b"]<-1
aedge["a","c"]<-1
aedge["b","c"]<-1
results <- get_graph_info(edgeMatrix=aedge, varVec=c("a", "b", "c"))
print(results)