Question
Compute the following using code in Mathematica. 1) RandomGraph[{m,n},k] generates k random undirected graphs with m vertices and n edges; if we want to generate
Compute the following using code in Mathematica.
1) RandomGraph[{m,n},k] generates k random undirected graphs with m vertices and n edges; if we want to generate directed graphs, we need to set the attribute DirectedEdges to True. Your first task is to create a nice interactive model that can generate k (directed or undirected!) graphs with m vertices and m(m-1)/2 edges. The possible values for k should be 1 and 4. The parameter m can be any positive integer between 4 and 10, with default value 6. You should have one extra parameter, called Directed, that can take the values True or False.
2) Build an interactive model with two controls, n and u, that generates a random graph called K with n vertices and 2n edges and highlights vertex u of graph K. When the user selects a different vertex u of K, you display graph K with vertex u shown with a different color and with a different size.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started