reset password
Author Message
rabbott
Posts: 1649
Posted 13:36 Apr 05, 2020 |

I was glad to see that nearly everyone participated and that teams submitted respectable, if not always complete and correct, code. Here are some comments.

 

You are not required to keep up with the changes I make to GitHub. When you start on an assignment, you can download the current GitHub version and use that. You need not update your copy every time I do an update. (Why didn't anyone ever ask about this on the Forum? I was not trying to make your life harder by updating GitHub all the time.)

In this assignment, the path-length was intended to be the number of hops, not the physical, i.e., pixel-to-pixel, distance from one node to another. (Why didn't anyone ask about this on the Forum?)

Python has a way of representing infinity: float('inf'). If you didn't use that for an infinite distance (e.g., for a path that doesn't exist) you should have. (If you wanted to know whether Python has a way of representing infinity, you should have asked about it on the Forum.) Although it may not be mathematically sound,

float('inf') == float('inf')  # => True.

An alternative would have been to use, say -1, as the path-length between two nodes that have no path between them.

When computing the average path length, the path from a node to itself should be ignored. (Why didn't anyone ever ask about this on the Forum?)

A simple way to implement preferential attachment is to select a link at random and then select one of its ends at random. Link the new node to the selected node.

PyLogo uses a number of constants, such as the height and width of the screen in pixels. If you needed that you could have asked about it on the Forum.

Attending class does not earn participation credit. It's the default.

If your algorithms are not complete, the entire team is responsible -- not just the person who was assigned to do the part that wasn't finished.

Even if you don't use it for development, I would appreciate your at least loading your code into PyCharm and fixing the problems it finds. (I recommend it for development as well, but that's not required.)

The function link_nodes_for_graph straggled on and on in many of the submissions. It should be broken up.

Last edited by rabbott at 13:40 Apr 05, 2020.