Skip to content

Bidentate #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 71 additions & 24 deletions nmf/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

#1d Graph square symmetry
c_1d = nx.Graph()
c_1d.add_node(0,typ="c")
c_1d.add_node(1,typ="e1")
c_1d.add_node(2,typ="e1")
c_1d.add_node(0,typ1 = "t", typ2 ="c1")
c_1d.add_node(1,typ1 = "t", typ2 ="e1")
c_1d.add_node(2,typ1 = "t", typ2 ="e1")
c_1d.add_weighted_edges_from([(0, 2, 1), (0, 1, 1)])

#2d Graph square symmetry
c_2d = nx.Graph()
c_2d.add_node(0,typ="c")
c_2d.add_node(1,typ="e1")
c_2d.add_node(2,typ="e1")
c_2d.add_node(3,typ="e1")
c_2d.add_node(4,typ="e1")
c_2d.add_node(0,typ1 = "t", typ2 ="c1")
c_2d.add_node(1,typ1 = "t", typ2 ="e1")
c_2d.add_node(2,typ1 = "t", typ2 ="e1")
c_2d.add_node(3,typ1 = "t", typ2 ="e1")
c_2d.add_node(4,typ1 = "t", typ2 ="e1")
c_2d.add_weighted_edges_from([(0, 2, 1), (0, 1, 1), (0, 3, 1), (0, 4, 1)])

#2d Graph with edge nodes connected to each other
Expand All @@ -28,13 +28,13 @@

#2d Graph Hexagonal symmetry
c_2d_hex = nx.Graph()
c_2d_hex.add_node(0,typ="c")
c_2d_hex.add_node(1,typ="e1")
c_2d_hex.add_node(2,typ="e1")
c_2d_hex.add_node(3,typ="e1")
c_2d_hex.add_node(4,typ="e1")
c_2d_hex.add_node(5,typ="e1")
c_2d_hex.add_node(6,typ="e1")
c_2d_hex.add_node(0,typ1 = "t", typ2 ="c1")
c_2d_hex.add_node(1,typ1 = "t", typ2 ="e1")
c_2d_hex.add_node(2,typ1 = "t", typ2 ="e1")
c_2d_hex.add_node(3,typ1 = "t", typ2 ="e1")
c_2d_hex.add_node(4,typ1 = "t", typ2 ="e1")
c_2d_hex.add_node(5,typ1 = "t", typ2 ="e1")
c_2d_hex.add_node(6,typ1 = "t", typ2 ="e1")
c_2d_hex.add_weighted_edges_from([(0, 2, 1), (0, 1, 1), (0, 3, 1), (0, 4, 1), (0, 5, 1), (0, 6, 1)])

#2d Hexagonal Graph with edge nodes connected to each other
Expand All @@ -44,17 +44,64 @@
#2d Graph with asymmetric bridge sites
custom_1 = nx.Graph()
custom_1 = nx.Graph()
custom_1.add_node(0,typ="c")
custom_1.add_node(2,typ="e1")
custom_1.add_node(4,typ="e1")
custom_1.add_node(6,typ="e1")
custom_1.add_node(8,typ="e1")
custom_1.add_node(1,typ="e2")
custom_1.add_node(5,typ="e2")
custom_1.add_node(3,typ="e3")
custom_1.add_node(7,typ="e3")
custom_1.add_node(0,typ1 = "b",typ2="c1")
custom_1.add_node(2,typ1 = "b",typ2="e1")
custom_1.add_node(4,typ1 = "b",typ2="e1")
custom_1.add_node(6,typ1 = "b",typ2="e1")
custom_1.add_node(8,typ1 = "b",typ2="e1")
custom_1.add_node(1,typ1 = "b",typ2="e2")
custom_1.add_node(5,typ1 = "b",typ2="e2")
custom_1.add_node(3,typ1 = "b",typ2="e3")
custom_1.add_node(7,typ1 = "b",typ2="e3")
custom_1.add_weighted_edges_from([ (0, 1, 2), (0, 7, 1), (0, 3, 1), (0, 5, 2),
(8, 2, 1), (2, 4, 2), (6, 4, 1), (6, 8, 2),
(2, 1, 0), (2, 3, 0), (3, 4, 0), (4, 5, 0),
(5, 6, 0), (6, 7, 0), (7, 8, 0), (8, 1, 0),
(2, 0, 0), (4, 0, 0), (6, 0, 0), (8, 0, 0)])

#2d graph for bidentates
c_2d_9 = nx.Graph()
c_2d_9.add_node(0,typ1 = "t", typ2 ="c1")
c_2d_9.add_node(1,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(2,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(3,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(4,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(5,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(6,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(7,typ1 = "t", typ2 ="e1")
c_2d_9.add_node(8,typ1 = "t", typ2 ="e1")
c_2d_9.add_weighted_edges_from([(0,1,1),(0,3,1),(0,5,1),(0,7,1),
(8,1,1),(8,7,1),(1,2,1),(2,3,1),
(7,6,1),(6,5,1),(5,4,1),(3,4,1)])
#2d graph Bridge-Top
c_tb = nx.Graph()
c_tb.add_node(0,typ = "c1")
c_tb.add_node(1,typ ="c2")
c_tb.add_node(18,typ ="c2")
c_tb.add_node(19,typ ="c2")
c_tb.add_node(20,typ ="c2")
c_tb.add_node(2,typ ="e1")
c_tb.add_node(4,typ ="e1")
c_tb.add_node(6,typ ="e1")
c_tb.add_node(8,typ ="e1")
c_tb.add_node(9,typ ="e2")
c_tb.add_node(10,typ ="e1")
c_tb.add_node(11,typ ="e2")
c_tb.add_node(12,typ ="e1")
c_tb.add_node(13,typ ="e2")
c_tb.add_node(14,typ ="e1")
c_tb.add_node(15,typ ="e2")
c_tb.add_node(16,typ ="e1")
c_tb.add_node(17,typ ="e2")
c_tb.add_node(3,typ = "e2")
c_tb.add_node(7,typ = "e2")
for i in range(0,c_tb.number_of_nodes()):
c_tb.add_weighted_edges_from([(i,i+1,0)]) #no adjacent top-bridge
if i%2 == 0 and i<15:
c_tb.add_weighted_edges_from([(i,i+2,1)])#top-top bond type
c_tb.add_weighted_edges_from([(0,i,1) for i in range(2,16,4)])#remaining top-top
c_tb.add_weighted_edges_from([(0,l,0) for l in range(18,21)]) #Remaining adjacent sites
c_tb.add_weighted_edges_from([(1,3,0),(3,5,0),(5,20,0),(20,1,0),(20,7,0),(7,9,0),(9,19,0),
(11,19,0),(19,18,0),(18,13,0),(11,13,0),(1,18,0),(18,15,0),(15,17,0),(17,1,0)]) #no adjacent bridges
c_tb.add_weighted_edges_from([(6,20,0),(18,14,0),(10,19,0)]) #remaining adjacent top-bridge

Loading