Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help me solve this question. It has to be done in Python Language. Please Don't use advanced python and solve it using basic python

Please Help me solve this question. It has to be done in Python Language. Please Don't use advanced python and solve it using basic python like functions, lists, tuples, dictionaries, strings, etc.image text in transcribed

Question 8. (A simplified page rank system.) Given a text file (pages.txt) which has lines of the form: URLnn, init_importance: text containing some URLnn. Each line represents a page with the first URLnn being its URL and init_importance is a number between 0 and 1.0, which gives the initial importance of this page. The URLnn in the rest of the line refers to the URL links to other pages that this page contains. (To simplify, instead of giving a full path, we are using URLnn, and instead of having separate files for each page, we are giving the text of a page as a line in the file). Example: URL00, 0.5: This is page zero, and has references to URL01, URL09, and also to URL08. It may have repeated references - so there are two references to URL09. URL02, 0.6: This is another page (page is represented as a line in this). This has reference to URL05, URL04, and URL00 Pages are ranked according to their overall importance. Let the total number of unique links in a page i be links[i] (i.e. these many unique pages this page refers to). The overall importance of a page i is sum over all the pages (j) which have a link to page i of: init_importance[j]/ links[j] (i.e. all the pages to which the page j has a link are distributed the importance of this page equally) Your program has to find the highest ranking N pages ( N can be set in a variable or taken as input) for a given input file. It seems natural to create a dictionary with page URL as the index, and having its init_importance, overall importance, the set of URLs it accesses, etc in it. Note. This simplified version has only one round of computation for the overall importance from the initi_importance. The ranking algorithm actually takes the current importance (starting with

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions