Create edge table from a specifig node table

Hello dear people,

I have a node table which look like following:

Relationship_ID | Node
0 | Node1
0 | Node2
0 | Node3
1 | Node1
1 | Node4

The Relationship_ID says, all Nodes with the same Relationsship_ID, are connencted to each other, respectively have a edge between it. So I need as result a Edge-table, which look likes the following:

NodeID1 | NodeID2
Node1 | Node2
Node1 | Node3
Node2 | Node3
Node1 | Node4

I’d be very grateful if anyone could help me.

Greeting Tamara

Hi @Takko

Another approach is like this create_edge_table.knwf (35.7 KB)

gr. Hans

4 Likes

Hi @Takko and welcome to the KNIME Forum,

Here is a component which transforms a node table to an edge table:

Create Edge Table.knar (27.9 KB)

Download the file and save the component (double click and then click finish) and use it in your workflow by dragging and dropping it from the “KNIME Explorer” pane (components come after the workflows in the list).

:blush:

4 Likes

Help was very usefull. Thank you for your time! :slightly_smiling_face:

2 Likes

Good morning everyone

Why not simply like this:
image

Rule for the Rule-Based Row Filter:

$Node$ >= $Node (#1)$ => TRUE

Result:
image

Or am I missing something?

Cheers
Aswin
KNIME_project2.knwf (7.5 KB)

3 Likes

Hi there all,

Agree with @Aswin on this one. Less is more! Only one thing I would add/change. I wouldn’t perform filtering on Node names cause this names can be dummy and won’t work on KNIME node names for example :slight_smile: So I would add integer Counter (either with Rule Engine or Counter Generation) prior to Joiner node and in Rule-based Row Filter would filter based it.

NodeEdges.knwf (31.8 KB)

Br,
Ivan

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.