Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

I want the user to be able to change the parent of a node. However, there has to be some check so that the loop situation does not arise. For eg. Parent of 9 is 8. Parent of 8 is 7. User might assign ...
StackNewbie's user avatar
0 votes
2 answers
1k views

hi there I have this struct info struct Node { int dest, weight; struct Node *next; }; I want to build a function that removes a specific node distance value my main function for calling the ...
noor shein's user avatar
5 votes
2 answers
2k views

What is an efficient way to implement Adjacency List Representation of Graph in C++? vector *edges; list *edges; map<int, int> *edges; map<int, map<int, int>> edges; In my opinion, ...
Smile001's user avatar
  • 167
0 votes
1 answer
681 views

I am building a MySQL relational database with the InnoDB engine for a shopping application as an exercise (I am a noob, so sorry in advance for beginner question). For product categories, I have ...
Ivan Z.'s user avatar
  • 67
0 votes
2 answers
1k views

My need is a very common select dropdown that displays hierarchical items where all child items are indented by adding &nbsp; I have gotten up to populating a dropdown in php with the right ...
Ricky Anthony's user avatar
0 votes
1 answer
406 views

I was looking into methods of deleting subtrees of trees stored in the adjacency list model. I set up this code, which deletes a complete tree using ON DELETE CASCADE. When I set max_ to a value > 14, ...
snflurry's user avatar
  • 187
0 votes
1 answer
172 views

I have a jqGrid TreeGrid that I load from server sorted just fine, where the nodes contain assets (leafs). Some of the assets are grouped into assemblies where those nodes are expandable. When the ...
Chance's user avatar
  • 45
2 votes
1 answer
549 views

I am working in SQL Server 2014. I have a strange data hierarchy situation. (At least, I haven't experienced something like it before.) In my hierarchy, there are several root / highest-level ...
skyline01's user avatar
  • 2,173
0 votes
1 answer
718 views

I want to find the minimum spanning tree in a graph structured as an adjacency list. I was able to figure out the MST using Prim's algorithm but my current solution doesn't use an adjacency list. ...
user1560400's user avatar
10 votes
3 answers
5k views

I've got a rather large (but quite sparse) adjacency matrix (500x500) that I am trying to visually represent. It seems to me that something akin to a force directed graph is my best bet and while ...
Drofdarb's user avatar
  • 159
0 votes
1 answer
68 views

I would like to build an Adjacency List from my list of sequence in a php. The thing is, that my list of sequince is in array and it looks like this: $arr = array("1", "1.1", "1.2", "2", "2.1", "2.1....
Sandi Horvat's user avatar
0 votes
1 answer
67 views

I'm trying to both serialize and deserialize the data in a graph format. The definition of my graph is the following one. #include <boost/graph/adjacency_list.hpp> #include <boost/graph/...
jackb's user avatar
  • 840
0 votes
1 answer
206 views

Example table: CREATE TABLE adj_list_model ( id INT NOT NULL AUTO INCREMENT, parent_id INT, my_string varchar(255),//some random information PRIMARY KEY (id) ) The tree I am creating ...
Webeng's user avatar
  • 7,098
5 votes
2 answers
6k views

For some reasons need to display data from a mysql database in 2 different tree views. Example Tree view 1 (using list tag): <li>level1 (Root) <ul> <li>level2</li> ...
emr tri's user avatar
  • 81
2 votes
1 answer
2k views

I have a fairly large number of user types that I need in my database and so far the only good option that does not involve lots and lots of tables is to use Adjacency List Model. Basically, my users ...
Cristian's user avatar
  • 2,570
3 votes
3 answers
2k views

I've a tree structure of categories stored in the mySQL table with category_id and parent_id relation. Parent_id = Null corresponds to the root node. Category (category_id, category_name, parent_id) ...
Mr.code892's user avatar
26 votes
1 answer
16k views

There are two ways to work with hierarchy data in MySQL: Adjacency List Model Nested Set Model A major problem of the Adjacency List Model is that we need to run one query for each node to get the ...
Gustavo Piucco's user avatar
3 votes
0 answers
351 views

If I have an adjacency list relationship as described by the Node class here, how would I get all of the descendants of that node? All of the ancestors of that Node?
Alex Rothberg's user avatar
0 votes
2 answers
259 views

I i have a table named Taxonomy it preaty much holds everything that has to do with the structure of the organization. as a school example table looks like id | name | type | parent 1 | 2014 | year |...
Momen Zalabany's user avatar
2 votes
1 answer
4k views

I have a table in my database containing all of my database categories, which I need to convert into a multi-level menu. The table structure is below: product_category_id | product_category_name | ...
Phil Young's user avatar
  • 1,394
0 votes
0 answers
1k views

I want to use adjacency list model in MySql following this tutorial: Managing Hierarchical Data in MySQL with query: SELECT t1.name AS lev1, t2.name as lev2, t3.name as lev3, t4.name as lev4 FROM ...
Val Smith's user avatar
1 vote
1 answer
599 views

I have to admin I'm not a SQL-guru, maybe this query is really simple but I can't manage to write it. Basically all pages are arranged using the adjacency list model (I'm tracking the deep too): +----...
gremo's user avatar
  • 48.9k
1 vote
1 answer
2k views

I'm having difficulty with the current model for my MySQL Table, namely that I can't seem to properly query all the child nodes of a specific parent. As the title states, I'm using the adjacency model....
Bitwize's user avatar
  • 11.4k
0 votes
1 answer
216 views

I have an array of data fetched from a database table that uses the adjacency model to build a heirarchy of topics. Each record contains the following fields: 'id' - a unique AI id. 'name' - a display ...
ShaunUK's user avatar
  • 917
0 votes
1 answer
1k views

i am trying to create a online shopping application using asp.net c# and mysql, i have many categories which has two level subcategories and and some categories do not have subcategories somewhat like:...
Vishal Torne's user avatar
1 vote
1 answer
790 views

i have a table category made up of adjacency list model: id name parent_id ------------------------------ 1 Clothing 0 2 Books 0 3 Computers 0 4 Mobiles ...
Vishal Torne's user avatar
0 votes
1 answer
559 views

If I have an adjacency list sorted by id/parent_id, is there an easy way to sort all of a parent's children alphabetically by a third text field (say "name")? I have used information provided here: ...
Jake's user avatar
  • 1
1 vote
0 answers
254 views

Jstree uses the nested set approach and while with static content this worked, we discussed our requirement with Ivan Bozhanov about re-using our table to allow each user to do operations with it and ...
Jean G.T's user avatar
0 votes
0 answers
478 views

Question: What design should one use when storing all user file/folder permissions in a MySQL database? Details: I am having trouble deciding whether Nested Set requires far too much insert time ...
puk's user avatar
  • 16.9k
0 votes
1 answer
215 views

I need help with a project that I am working on: How do I calculate left and right in a Nested Set Model assuming all inputs come in in no particular order. 4 forms are distributed, each form brings ...
dasersoft's user avatar
  • 153
0 votes
1 answer
748 views

I am using the adjacency list model to find sub categories within my website. I have working PHP code to find all the categories and sub categories, but now I cannot figure out how use that to create ...
brandon14_99's user avatar
0 votes
1 answer
416 views

Hello I'm trying to get a multicolumn display (if it can be called so) with the code below here is the result: . Someone can see why These leaves are broken? or tell me please which is better: a ...
jartaud's user avatar
  • 385
3 votes
1 answer
2k views

So I think my issue boils down to two questions: How do I build a traversable tree structure in PHP when the tree is stored in MySQL (between two tables) using the Adjacency List Model approach while ...
Lauren's user avatar
  • 89
4 votes
5 answers
2k views

I've got a 'task list' database that uses the adjacency list model (see below) so each 'task' can have unlimited sub-tasks. The table has an 'TaskOrder' column so everything renders in the correct ...
Nick's user avatar
  • 5,696