GraphEdgeAttribute | index ../../../../piana/code/Graph/GraphEdgeAttribute.py |
File : GraphEdgeAttribute.py
Author : Daniel Jaeggi and Ramon Aragues
Creation : 2003
Contents : class GraphEdgeAttribute
=======================================================================================================
Skeleton attribute classes for edges in a graph.
Edges in a graph are just abstract containers and only have
"real world" meanings by containing attributes. For each particular
problem, custon edge attributes must be defined.
For example, we may be modeling the network formed by Hollywood actors.
Actors form the nodes and films in which both actors have starred form
the edges. We could then define custom edge and node attributes thus:
class FilmLink(EdgeAttribute):
# class defining edge between 2 actors based on appearance in the same film
def __init__(self, film, director, year):
self.film = film
self.director = director
self.year = year
Attributes in this way can be arbitrarily complex
Classes | ||||||||||
|