Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lecture "Organising information: graphs", exercise 1 #37

Open
essepuntato opened this issue Dec 14, 2021 · 10 comments
Open

Lecture "Organising information: graphs", exercise 1 #37

essepuntato opened this issue Dec 14, 2021 · 10 comments
Labels

Comments

@essepuntato
Copy link
Contributor

Consider the list of co-authors of Tim Berners-Lee as illustrated in the right box at http://dblp.uni-trier.de/pers/hd/b/Berners=Lee:Tim. Build an undirected graph containing Tim Berners Lee as the central node, linking it to five nodes representing his top-five co-authors. Also, specify the weight of each edge as an attribute, where the value of the weight is the number of bibliographic resources (articles, proceedings, etc.) Tim Berners-Lee has co-authored with the person linked by that edge.

@MaddaGh
Copy link

MaddaGh commented Dec 15, 2021

Graph1
Graph2

@chloeppd
Copy link

from networkx import MultiGraph

tbl=MultiGraph()
tbl.add_node("Tim Berners-Lee")
tbl.add_edge("Tim Berners-Lee", "Tom Heath", weight=18)
tbl.add_edge("Tim Berners-Lee", "Christian Bizer", weight=18)
tbl.add_edge("Tim Berners-Lee", "Sören Auer", weight=10)
tbl.add_edge("Tim Berners-Lee", "Lalana Kagal", weight=9)
tbl.add_edge("Tim Berners-Lee", "James A. Hendler ", weight=8)

@OrsolaMBorrini
Copy link

from networkx import MultiGraph

TBLee_graph = MultiGraph()
TBLee_graph.add_node("Tim Berners Lee")
TBLee_graph.add_node("Tom Heath")
TBLee_graph.add_node("Christian Bizer")
TBLee_graph.add_node("Sören Auer")
TBLee_graph.add_node("Lalana Kagal")
TBLee_graph.add_node("James A. Hendler")

TBLee_graph.add_edge("Tim Berners Lee","Tom Heath", weight=18)
TBLee_graph.add_edge("Tim Berners Lee","Christian Bizer", weight=18)
TBLee_graph.add_edge("Tim Berners Lee","Sören Auer", weight=10)
TBLee_graph.add_edge("Tim Berners Lee","Lalana Kagal", weight=9)
TBLee_graph.add_edge("Tim Berners Lee","James A. Hendler", weight=8)

@Postitisnt
Copy link

from networkx import Graph

TBL_graph = Graph()

TBL_graph.add_edge("Tim Berners-Lee", "Tom Heath", weight=18)
TBL_graph.add_edge("Tim Berners-Lee", "Christian Bizer", weight=18)
TBL_graph.add_edge("Tim Berners-Lee", "Sören Auer", weight=10)
TBL_graph.add_edge("Tim Berners-Lee", "Lalana Kagal", weight=9)
TBL_graph.add_edge("Tim Berners-Lee", "James A. Hendler ", weight=8)

print(TBL_graph.nodes())
print(TBL_graph.edges(data=True))

@AnastasiyaSopyryaeva
Copy link

from networkx import Graph

coauthors = Graph()
coauthors.add_node("Tim Berners Lee")
coauthors.add_edge("Tim Berners Lee", "Tom Heath", weight = 18)
coauthors.add_edge("Tim Berners Lee", "Christian Bizer", weight = 18)
coauthors.add_edge("Tim Berners Lee", "Soren Auer", weight = 10)
coauthors.add_edge("Tim Berners Lee", "Lalana Kagal", weight = 9)
coauthors.add_edge("Tim Berners Lee", "James A. Hendler", weight = 8)

print(coauthors.nodes())
print(coauthors.edges(data=True))

@ManueleVeggi
Copy link

from networkx import Graph

tmblGraph = Graph()
tmblGraph.add_node("Tim Berners-Lee")
tmblGraph.add_node("Tom Heath")
tmblGraph.add_node("Christian Bizer")
tmblGraph.add_node("Sören Auer")
tmblGraph.add_node("James A. Hendler")
tmblGraph.add_node("Daniel J. Weitzner")

tmblGraph.add_edge("Tim Berners-Lee", "Tom Heath", weight = 18)
tmblGraph.add_edge("Tim Berners-Lee", "Christian Bizer", weight = 18)
tmblGraph.add_edge("Tim Berners-Lee", "Sören Auer", weight = 10)
tmblGraph.add_edge("Tim Berners-Lee", "James A. Hendler", weight = 9)
tmblGraph.add_edge("Tim Berners-Lee", "Daniel J. Weitzner", weight = 8)

@katya-avem
Copy link

image

@angstigone
Copy link

angstigone commented Dec 19, 2021

Schermata 2021-12-19 alle 19 43 23

@AmeliaLamargese
Copy link

from NetworkX import Graph

my_graph = Graph()

my_graph.add_node(1, name = "Tim Berners Lee")
my_graph.add_node(2, name = "Tom Heath")
my_graph.add_node(3, name = "Christian Bizer")
my_graph.add_node(4, name = "Sören Auer")
my_graph.add_node(5, name = "Lalana Kagal")
my_graph.add_node(6, name = "James A. Hendler")

my_graph.add_edge(1, 2, weight = 18)
my_graph.add_edge(1, 3, weight = 18)
my_graph.add_edge(1, 4, weight = 10)
my_graph.add_edge(1, 5, weight = 9)
my_graph.add_edge(1, 6, weight = 8)

@NoraPs
Copy link

NoraPs commented Dec 20, 2021

Cattura

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests