GVGEN(1)

πŸ’– GVGEN β€” bestie edition πŸ’–

okay so. you know how sometimes you just need a graph. like, a structured one. not a "draw it by hand and cry" one. well, gvgen is literally that girl. she generates graphs. lots of them. regularly-structured abstract ones. slay.


✨ NAME ✨

gvgen β€” generate graphs πŸ¦‹ (yes that's the whole vibe, she makes graphs, she's an icon, she's been doing this since 2012)


🌸 SYNOPSIS 🌸

gvgen [ -dv?  ] [ -in ] [ -cn ] [ -Cx,y ] [ -g[f]x,y ] [ -G[f]x,y ] [
-hn ] [ -kn ] [ -bx,y ] [ -Bx,y ] [ -mn ] [ -Mx,y ] [ -pn ] [ -rx,y ] [
-Rx ] [ -sn ] [ -Sn ] [ -Sn,d ] [ -tn ] [ -td,n ] [ -Tx,y ] [ -Tx,y,u,v
] [ -useed ] [ -wn ] [ -nprefix ] [ -Nname ] [ -ooutfile ]

πŸ’… DESCRIPTION πŸ’…

so gvgen generates a whole variety of simple, regularly-structured abstract graphs. that's it. that's the whole job. she's not complicated, she's just good at it. no cap. πŸ’œ


πŸŽ€ OPTIONS πŸŽ€

the following options are supported, bestie, and there are a lot of them, so buckle up:

  • -c n β€” makes a cycle with n vertices and edges. cute little loop-de-loop energy. πŸ”„
  • -C x,y β€” makes an x by y cylinder. this is gonna have x*y vertices and 2*x*y - y edges. it's giving "toilet paper tube but make it math". 🧻
  • -g [f]x,y β€” makes an x by y grid. if f is given, the grid is folded, with an edge attaching each pair of opposing corner vertices (like folding a paper and stapling the corners, unhinged but ok). this will have x*y vertices, and 2*x*y - y - x edges if unfolded, or 2*x*y - y - x + 2 edges if folded. yes the math is mathing. ✨
  • -G [f]x,y β€” makes an x by y partial grid. if f is given, the grid is folded, with an edge attaching each pair of opposing corner vertices. this one will have x*y vertices. that's the whole tea. 🍡
  • -h n β€” makes a hypercube of degree n. this will have 2^n vertices and n*2^(n-1) edges. hypercube said "I contain multitudes" and honestly? she does. 🧊
  • -k n β€” makes a complete graph on n vertices with n*(n-1)/2 edges. everyone knows everyone. the group chat where literally every person is mutuals. πŸ‘‘
  • -b x,y β€” makes a complete x by y bipartite graph. this will have x+y vertices and x*y edges. two friend groups who all know each other across the aisle. 🀝
  • -B x,y β€” makes an x by y ball, i.e., an x by y cylinder with two "cap" nodes closing the ends. this will have x*y + 2 vertices and 2*x*y + y edges. the cylinder got a little hat on each end. 🎩
  • -m n β€” makes a triangular mesh with n vertices on a side. this will have (n+1)*n/2 vertices and 3*(n-1)*n/2 edges. triangle girlies rise up. πŸ”Ί
  • -M x,y β€” makes an x by y Moebius strip. this will have x*y vertices and 2*x*y - y edges. one side, one edge, zero chill. ♾️
  • -p n β€” makes a path on n vertices. this will have n-1 edges. just a lil line of nodes holding hands. 🫢
  • -r x,y β€” makes a random graph 🌈. the number of vertices will be the largest value of the form 2^n-1 less than or equal to x. larger values of y increase the density of the graph. so y is basically the "how much chaos do you want" dial. πŸ’€
  • -R x β€” makes a random rooted tree on x vertices. 🌳
  • -s n β€” makes a star on n vertices. this will have n-1 edges. one main character, everyone else is a supporting role. ⭐
  • -S n β€” makes a Sierpinski graph of order n. this will have 3*(3^(n-1) + 1)/2 vertices and 3^n edges. fractal excellence, we love to see it. πŸ”ΊπŸ”ΊπŸ”Ί
  • -S n,d β€” makes a d-dimensional Sierpinski graph of order n. at present, d must be 2 or 3. for d equal to 3, there will be 4*(4^(n-1) + 1)/2 vertices and 6 * 4^(n-1) edges. > ngl bestie, only 2 and 3 are valid right now β€” don't try to be cute and pass d = 7, it will not go how you want. πŸ™ˆ
  • -t n β€” makes a binary tree of height n. this will have 2^n-1 vertices and 2^n-2 edges. 🌲
  • -t h,n β€” makes an n-ary tree of height h.
  • -T x,y
  • -T x,y,u,v β€” makes an x by y torus. this will have x*y vertices and 2*x*y edges. if u and v are given, they specify twists of that amount in the horizontal and vertical directions, respectively. donut shaped. torus girlies, this one's for you. 🍩
  • -u seed β€” specify the initial state for the random number generator. if this option is not given, the current time is used to derive a seed. so if you want reproducible randomness (iconic oxymoron, I know), this is your girl. 🎲
  • -w n β€” makes a path on n vertices. this will have n-1 edges. (yes, same energy as -p. she contains multitudes.) 🫢
  • -i n β€” generate n graphs of the requested type. at present, only available if the -R flag is used. so like, it's conditional, it's exclusive, it's giving "you can't sit with us unless you brought -R". πŸ’…
  • -n prefix β€” normally, integers are used as node names. if prefix is specified, this will be prepended to the integer to create the name. boom, your nodes have last names now. 🏷️
  • -N name β€” use name as the name of the graph. by default, the graph is anonymous. she's mysterious, she's elusive, she's unlabeled. πŸ•ΆοΈ
  • -o outfile β€” if specified, the generated graph is written into the file outfile. otherwise, the graph is written to standard out. πŸ“
  • -d β€” make the generated graph directed. arrows. direction. drama. ➑️
  • -v β€” verbose output. she will tell you things. lots of things. πŸ—£οΈ
  • -? β€” print usage information. the "help me bestie" flag. ❓

πŸ¦‹ EXIT STATUS πŸ¦‹

gvgen exits with 0 on successful completion, and exits with 1 if given an ill-formed or incorrect flag, or if the specified output file could not be opened. so like, 0 is the slay, 1 is the "bestie what did you type". 😭


πŸ‘‘ AUTHOR πŸ‘‘

Emden R. Gansner <erg@research.att.com> β€” the icon, the legend, the moment. πŸ™Œ


🌈 SEE ALSO 🌈

gc(1), acyclic(1), gvpr(1), gvcolor(1), ccomps(1), sccmap(1), tred(1), libgraph(3)

go read those too, they're all part of the same friend group. iykyk. πŸ’–


okay bestie that's the whole page!! πŸ’œ this was the GVGEN(1) manual, dated 5 June 2012 β€” yeah she's a vintage queen and she still eats, no cap. go generate something iconic. mwah. πŸ’‹βœ¨

πŸ“¦ where this page comes from