Questions tagged [hierarchical]

For issues relating to arranging data and/or resources in a hierarchy.

A hierarchy is an arrangement of items (objects, names, values, categories, resources, etc.) in which the items are represented as being "above," "below," or "at the same level as" one another. Abstractly, a hierarchy is simply an ordered set or an acyclic directed graph.

A hierarchy can link entities either directly or indirectly, and either vertically or horizontally. The only direct links in a hierarchy, insofar as they are hierarchical, are to one's immediate superior or to one of one's subordinates, although a system that is largely hierarchical can also incorporate alternative hierarchies. Indirect hierarchical links can extend "vertically" upwards or downwards via multiple links in the same direction, following a path. All parts of the hierarchy which are not linked vertically to one another nevertheless can be "horizontally" linked through a path by traveling up the hierarchy to find a common direct or indirect superior, and then down again.

568 questions
10
votes
3 answers

Is it possible to reference a different column in the same table?

If a blog has a 'categories' table such as the following: CREATE TABLE categories ( id INTEGER PRIMARY KEY AUTO_INCREMENT, parent_id INTEGER NOT NULL, name VARCHAR(30) NOT NULL, description TEXT, count INTEGER NOT NULL DEFAULT 0 ); And…
Jim Johnson
  • 2,469
  • 2
  • 15
  • 13
9
votes
2 answers

Generating HierarchyID

I would like to insert the hierarchyId like this / - CEO (Root) /1/ - Purchase Manager /1/1/ - Purchase Executive /2/ - Sales Manager /2/1/ - Sales Executive This is what the hierarchy i would like to use, is it right one, if so how can…
Mohanavel
  • 1,763
  • 3
  • 22
  • 44
9
votes
1 answer

How can I create a Hierarchical block with GNURadio Companion?

I am trying to create a Hierarchical block using the GNURadio Companion GUI. Answers I've found in other posts say to select the blocks you want to incorporate, then go to More -> Create Hier. Then a new screen is supposed to appear. However,…
HoosierPhysics
  • 133
  • 1
  • 8
9
votes
4 answers

What is the best practice for a hierarchical state machine using the state pattern?

I'm about to implement a hierarchical state machine in C# using the state pattern. As a guide I'm using this example. The example doesn't provide an answer regarding hierarchical states though. Unfortunately, I can't seem to find good examples…
user341877
  • 237
  • 2
  • 12
8
votes
1 answer

What are the principles involved for an Hierarchical State Machine, and how to implement a basic model?

So I'm attempting to make a game using C++, and I've read a ton of articles on Finite State Machines (FSM), and Hierarchical State Machines (HSM). However I will admit most of the stuff I've read is a bit dense and hard to understand, so I was…
Rivasa
  • 6,510
  • 3
  • 35
  • 64
7
votes
2 answers

What strategy to use in Java for hierarchical reentrant read/write locking?

I'm looking for en efficient system to have a series of read/write locks organized hierarchically to manage access to hierarchically organized resources. If a subtree is locked for write, then no other lock should be able to be obtained in the whole…
Jean-Philippe Pellet
  • 59,296
  • 21
  • 173
  • 234
7
votes
2 answers

PHP Multidimensional array to unordered list, building up url path

I have a multidimensional array in PHP produced by the great examples of icio and ftrotter (I am use ftrotterrs array in arrays variant): Turn database result into array I have made this into a unordered list width this method: public function…
Klaaz
  • 1,590
  • 3
  • 23
  • 46
7
votes
2 answers

SORTING Hierarchical Queries in SQL Server 2005

I have following issue: I have a table for maintaining the hierarchical data. I'd like to use CTE from SQL 2005. WITH tree (id, parentid, code, name) AS ( SELECT id, ofs.ParentID, ofs.code, ofs.name FROM OrganizationFeatures ofs WHERE…
7
votes
3 answers

Designing interface for hierarchical entity

I have to design an interface for hierarchical entity: interface HierarchicalEntity> { T getParent(); Stream getAncestors(); } It's quite easy to implement default getAncestors() method in terms of…
Aliaxander
  • 2,547
  • 4
  • 20
  • 45
7
votes
1 answer

Order of bean destruction in Spring context hierarchy

Is it correct to say that when a Spring context hierarchy is closed, there is no guaranteed order in which the beans will be destroyed? E.g. the beans in the child context will be destroyed before the parent context. From a minimal example the…
7
votes
1 answer

closure tables with entity framework 6

I want to implement hierarchical data structure (e.g Product --> Product 2 ----> Product3, Product 2----> Product4) using entity framework 6 code first approach. There are several approaches available but i think closure table approach is one that…
Nabeel
  • 784
  • 3
  • 9
  • 23
7
votes
1 answer

Changing data in a dataframe with hierarchical indexing

How can I change every element in a DataFrame with hierarchical indexing? For example, maybe I want to convert strings into floats: from pandas import DataFrame f = DataFrame({'a': ['1,000','2,000','3,000'], 'b':…
r_31415
  • 8,752
  • 17
  • 74
  • 121
6
votes
2 answers

Storing hierarchical data in MySQL with high write load

I am building web application that should have high write load and thousands, even millions of hierarchical records representing user defined/constructed trees. I am not trying to build forum with threads but huge database with thousands of…
idenoq
  • 83
  • 5
6
votes
1 answer

Flutter BloC with nested data structure

I have a nested structure, something like this: List |-- List | |-- List This is the workflow of my app: App is opened Fetch API and display a list of Areas The user chooses an Area and go to next screen Fetch API and…
Ale
  • 2,282
  • 5
  • 38
  • 67
6
votes
4 answers

Pandas hierarchical sort

I have a dataframe of categories and amounts. Categories can be nested into sub categories an infinite levels using a colon separated string. I wish to sort it by descending amount. But in hierarchical type fashion like shown. How I need it…
Pierce
  • 101
  • 7
1
2
3
37 38