In graph theory, a
complete graph is one in which there is an edge between each pair of distinct nodes.
USING: kernel math.combinatorics math.parser sequences
graphviz graphviz.notation graphviz.render ;
: K_n ( n -- )
<graph>
[node "point" =shape ];
[graph "t" =labelloc "circo" =layout ];
over number>string "K " prepend =label
swap <iota> 2 [ first2 add-edge ] each-combination
preview ;
5 K_n
6 K_n
7 K_n