Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

removeSelfLoops

remove self loops in a graph


Description

remove self loops in a graph

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.

Author(s)

Li Long <li.long@isb-sib.ch>

Examples

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

g2 <- ugraph(g1)
removeSelfLoops(g2)

RBGL

An interface to the BOOST graph library

v1.66.0
Artistic-2.0
Authors
Vince Carey <stvjc@channing.harvard.edu>, Li Long <li.long@isb-sib.ch>, R. Gentleman
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.