Tags » MST

Intra-semester test drama

This doesn’t happen every time. Because the 2011 past paper was the same as the 2012 past paper, and the 2013 past paper was leaked onto our Facebook group page with good intent, there were some students who had access to an ‘unfair advantage’ because the 2014 paper entailed similar questions. 104 more words

Biomed

staff

Twice a year, in the fall and the spring, staff members fan out across the country for Site Visits. This just happened in March, and it was during this visit that I realized that something was missing from this blog and I aim to correct that here. 822 more words

Twila, Da Girl Who Was In Luv W/A Vampir Ch. 2

Fandom: Twilight

This chapter is just…awful. Lots of fighting…over a Sue. And Burger King. You don’t want to miss out.

Twila, Da Girl Who Was In Luv W/A Vampir Ch. 1

Fandom: Twilight

I don’t know anything really about this story besides that this is most likely a self insert fanfiction with terrible writing quality. Most likely a trollfic based off the author’s love of… 1,171 more words

Prims Minimum Spanning Tree Algorithm in Python


final = []

edges = {
            'A':{'D':1,'B':3},
            'B':{'A':3,'C':4},
            'C':{'B':4,'D':5,'A':2,'E':7},
            'D':{'A':1,'C':5,'E':6},
            'E':{'D':6,'C':7}
        }

# here NULL represented by -1 and Infinity represented by 1000

vertices = {
            'A':,
            'B':,
            'C':,
            'D':,
            'E':
            }

def EXTRACTMIN():
    low = list(vertices.keys())[0]
    for key in vertices.keys():
        if vertices[0]>vertices[0]:
            low=key
    del vertices
    return low

vertices['A'][0]=0

while not(vertices=={}):
    u=EXTRACTMIN()
    final.append(str(u))
    for v in .keys()]:
        if v in vertices and edges[u][v]<vertices[v][0]:
            vertices[v][0]=edges[u][v]

print("->".join(final))
Algorithms

Kruskal's Minimum Spanning Tree Algorithm in Python


# A is an empty set in starting

A = set()

# Dynamic set of all disjoint set vertices

S={"a":['a'],"b":['b'],"c":['c'],"d":['d'],"e":['e']}

# all the edges present in a graph arranged in increasing order wrt to WEIGHT

edges=[('a','b'),('b','e'),('e','d'),('d','a'),('a','c'),('c','b'),('c','e'),('c','e')]

# function to return the set representative which is the first element of key in set S

def findset(u):
    for key in S.keys():
        if u in key:
            return key[0]

# union function to delete keys containg u and v from set S and adding the key:lsta combination in the dictionary

def union(u,v):
    m=[]
    lsta=[]
    DEL=[]
    for key in S.keys():
        if u in key:
            m.append(key)
            DEL.append(key)
            lsta.extend(S)
            break
    for key in S.keys():
        if v in key:
            DEL.append(key)
            m[0]+=key
            lsta.extend(S)
            break
    del S]
    del S]
    S]=lsta

# itereate over all the edges

for item in edges:
    u = item[0]
    v = item[1]

    print(S)

    # if  set representative is not the same for elements u and v perform union operation

    if not(findset(u)==findset(v)):

        # add the edge to the set A

        A.add(item)
        union(u,v)

# print all the edges present in the minimum spanning tree

print(A)
Algorithms

Women leading resistance to eucalyptus plantations in Brazil

Note: In the US, South Carolina-based ArborGen is awaiting a decision from the US Department of Agriculture to sell billions of genetically engineered (GE) eucalyptus trees annually for planting across the southeast US.  

1,672 more words
Actions / Protest