Parvfect / HelixWorks

Code for the Channels and Decoding Methods
0 stars 0 forks source link

Visual for Tanner Graph Data Structure #6

Open Parvfect opened 8 months ago

Parvfect commented 8 months ago

Having a Visual would just be incredible for the Tanner Data Structure.

Parvfect commented 8 months ago

Preliminary look into it resulted in -

 def visualise(self):
        """ Visualise Tanner Graph """
        G = nx.Graph()

        rows = len(self.cns)
        cols = len(self.vns)

        # For each row add a check node
        for i in range(rows):
            G.add_node(i, bipartite=0)

        # For each column add a variable node
        for i in range(cols):
            G.add_node(i + rows, bipartite=1)

        # Utilise the links to add edges
        for (i,j) in enumerate(self.cns):
            for k in j.links:
                G.add_edge(i, k + rows, weight=1)

But, does not work :( Currently attempting to utilise networkx for the visualisation, may be worth looking at alternatives. Should not be too difficult.