How to represent a multiset?

425 Views Asked by At

I have a graph $G(V,E)$ and each $v_i\in V$ has a value $v_i\cdot s$ ($v_i\cdot s$'s are not unique). How can I show a multiset representing the $v_i\cdot s$'s? This is what I have come up with so far which doesn't seem to be correct ($V$ is the set of vertices and $S$ is the set of values).

$\forall v_i\in V$ and $S=\{v_i\cdot s\mid v_i\in V\}$ and $f:S\to{\mathbb N}$ which finds the frequency of each $v_i\cdot s$, we define multiset $(S,f)$.

1

There are 1 best solutions below

4
On

Your question is not entirely clear to me, but if by multiset you mean a set in which elements may appear more than once but only a finite number of time, then one way to represent such objects is as follows. A multiset is a set $S$ together with a function $S\to \mathbb N$ from the set $S$ to the non-negative integers.