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

is_weighted

Weighted graphs


Description

In weighted graphs, a real number is assigned to each (directed or undirected) edge.

Usage

is_weighted(graph)

Arguments

graph

The input graph.

Details

In igraph edge weights are represented via an edge attribute, called ‘weight’. The is_weighted function only checks that such an attribute exists. (It does not even checks that it is a numeric edge attribute.)

Edge weights are used for different purposes by the different functions. E.g. shortest path functions use it as the cost of the path; community finding methods use it as the strength of the relationship between two vertices, etc. Check the manual pages of the functions working with weighted graphs for details.

Value

A logical scalar.

Author(s)

Examples

g <- make_ring(10)
shortest_paths(g, 8, 2)
E(g)$weight <- seq_len(ecount(g))
shortest_paths(g, 8, 2)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

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