Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please assist me with the following practice questions. I will comment where you can find the mentioned py files and such. If you would like

Please assist me with the following practice questions. I will comment where you can find the mentioned py files and such. If you would like me to send them to you another way please let me know.

image text in transcribed
2a. (5 pts) Write a script that uses the cProfile module to profile all the functions called when the find_influencers3 function (a faster version of find_influencers) is run on a random graph that has been constructed with 10,000 nodes and 50,000 edges. Generate the random graph first (do not include its generation in the profile information) and then call CProfile. run so that it runs find_influencers3 on that graph; also specify a second argument, which is the file to put the results in (and the file on which to call pstats . Stats) to print the results. For the first one, sort the results decreasing by ncalls (print at most the top 20); for the second one, sort the results decreasing by tottime (print at most the top 20). Hint: The notes show how to instruct the profiler put the profile information into a file and then show how to access that file and format the results it displays to the console; I had 23 lines in my module (including blank lines). It should take only a few seconds to profile this code. See the file sample8.pdf (included in the download) for what your output should look like: of course, your counts and times will depend on the speed of your computer and the random graph generated. 2b. (2 pts) Answer the questions in part 2b of the empirical . doc document (included in the download) with the data that you collect (or the data in sample8.pdf if you cannot get your code to produce the correct results)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions