# how to define a function which returns a multiset

Given graph $G(V,E)$, how can I formally define function $f\prime$ which takes a node $v \in V$ and returns a multiset?

• A multiset can be defined as a set of couples of the form $(x, n) \in X \times \mathbb{N}$, where $X$ is your base set, and $n$ the multiplicity. A multiset is just a subset of all possible couples, so the return value is a member of the powerset of $X \times \mathbb{N}$. So formally you can write $f : V \rightarrow P(X \times \mathbb{N})$ (where $P(S)$ denotes the powerset of $S$). Commented Apr 8, 2014 at 18:02

A multiset is a function $\nu$ defined on some ground set $X$ with values in ${\mathbb N}_{\geq0}$. Such a function assigns each element $x\in X$ its "multiplicity" $\nu(x)$.
When you have a function $f$ that assigns to each node $v\in V$ a multiset $\nu$ on some ground set $X$ I'd suggest to denote the multiset corresponding to the node $v$ by $\nu_v\>$. In this way $\nu_v(x)$ denotes the multiplicity of $x$ foreseen by $f$ for the given node $v$.