removeSelfLoops

remove self loops in a graph

remove self loops in a graph

Keywords
models
Usage
removeSelfLoops(g)
Arguments
g
one instance of the graph class
Details

If a given graph contains self-loop(s), removeSelfLoops removes them. This is for those functions that cannot handle graphs with self-loops.

Value

A new graph without self loops.

Aliases
  • removeSelfLoops
Examples
con <- file(system.file("XML/dijkex.gxl",package="RBGL"))
g1 <- fromGXL(con)
close(con)

g2 <- ugraph(g1)
removeSelfLoops(g2)
Documentation reproduced from package RBGL, version 1.48.1, License: Artistic-2.0

Community examples

Looks like there are no examples yet.