Home

mapEdges

mapEdges is a concept used in graph theory and graph processing to describe a transformation that assigns to every edge in a graph a value from a chosen target set, or that otherwise replaces edge data. It is an edge-centric counterpart to vertex-focused mappings and is often used to derive new graphs or annotate existing ones with computed attributes.

Formally, let G = (V,E) be a graph and let f be a function that associates each edge

Examples include creating a weighted graph by setting w'(e) = f(e) for all e, or generating a labeled

In software libraries, mapEdges is often implemented as a higher-order operation that takes a function parameter

See also mapVertices, graph transformation, edge labeling.

e
∈
E
with
a
value
in
a
set
X.
Applying
mapEdges
to
G
with
f
yields
a
transformed
object
in
which
each
edge
carries
the
value
f(e).
Depending
on
the
context,
this
may
produce
a
new
edge-labeled
graph,
alter
edge
weights,
or
define
a
new
edge
set.
graph
where
the
label
on
e
is
f(e).
In
some
frameworks,
mapEdges
can
also
map
edges
to
new
edges,
effectively
transforming
the
topology,
though
this
is
less
common
and
requires
careful
handling
to
maintain
vertex
correspondences.
and
returns
a
new
graph
with
each
edge
data
transformed
accordingly.
This
is
useful
in
pipelines
that
require
edge-wise
feature
computation,
normalization,
or
filtering
without
mutating
the
original
graph.