473,383 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

merge two nodes of adjacency list

1
how can i merge 2 nodes in a graph in 1 node , need to save the in and out edges and the nodes that was merged for contribution after that

for example a graph implementation in adj list:
1->3->4->6
2->3->4->6
5->4->6

and i want to merge the nodes 3 and 4 , then new nodes should be created 7 as :
1->7->6
2->7->6
5->7->6
7->6

the node 7 also will save [include 3,4 the merged nodes]
any one can help with that please

the implementation should be in c code.


typedef struct AdjListEntry {
int visited;
int index;
struct AdjListNode current; // node iniformation
struct AdjListEntry* next;
} AdjListEntry;

typedef struct AdjListNode {
int Uind;
char name[10];
char label[10];
adjOutEddgeLists *outEddges;
//adjInEddgeLists *inEddges;
} AdjListNode;

typedef struct adjOutEddgeLists{
AdjListNode *listNode;
adjOutEddgeLists *next;
}adjOutEddgeLists;
Feb 1 '16 #1
0 1198

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jef Driesen | last post by:
I need some help to implement the adjacency list representation of a (undirected) graph. The data structure I need is something like the picture on the website...
19
by: Christian Fowler | last post by:
I have a VERY LARGE pile of geographic data that I am importing into a database (db of choice is postgres, though may hop to oracle if necessary). The data is strictly hierarchical - each node has...
12
by: Steve | last post by:
I have been studying the Adjacency List Model as a means of achieving a folder structure in a project I am working on. Started with the excellent article by Gijs Van Tulder ...
46
by: junky_fellow | last post by:
Hi, Is there any efficient way of finding the intesection point of two singly linked lists ? I mean to say that, there are two singly linked lists and they meet at some point. I want to find...
7
thatos
by: thatos | last post by:
Here is the EdgeList class class Graph { protected int numvertices; protected int numedges; protected boolean directed; protected EdgeList adjlist ; // Constructors
12
by: JD | last post by:
Hi, I need help for a task looks very simple: I got a python list like: , , , , , , ] Each item in the list need to be merged.
2
by: orzeech | last post by:
Here's my code that's supposed to be a basic graph implementation using adjacency lists. It comes straight from R.Sedgewick's "Algorithms in C++". However "23 - ISO C++ forbids declaration of...
8
by: iokon | last post by:
The following code is part of a bigger project in which I simulate a non-directed graph using adjacency lists. The code has no compilation errors. When I use in my main function (which is not...
1
by: John Papadopoul | last post by:
Hi all, I'm using the BOOST libraries to compute an adjacency list and its transitive closure. I'm defining them as follows: ... typedef boost::adjacency_list<> AdjacencyList; AdjacencyList...
1
by: Shailesh A | last post by:
Hi, Does anyone know a way to get a list of nodes from list of instances? Meaning, I can have a list of instances from customers (or can get a list of instances from db2ilist). However, I want to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.