File: is_weighted.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (42 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attributes.R
\name{is_weighted}
\alias{is_weighted}
\title{Weighted graphs}
\usage{
is_weighted(graph)
}
\arguments{
\item{graph}{The input graph.}
}
\value{
A logical scalar.
}
\description{
In weighted graphs, a real number is assigned to each (directed or
undirected) edge.
}
\details{
In igraph edge weights are represented via an edge attribute, called
\sQuote{weight}. The \code{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.
}
\examples{

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

}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\keyword{graphs}