Multiple level bom search

P

pengbsam

Hello:
I need to write a program that search through multiple level BOM,
get all the items. It seems like a easy enough project, but when I put
my hands on it and couple of hundred lines of codes later. It starts
look more difficult. I was hopeing someone might have a very easy way
to do it that I don't know about... The BOM structure looks like this..

Father Child
A 1
A 2
1 1.1
1 1.2
2 2.2
1.1 A1

So result search should be ... A, 1, 2, 1.1, 1.2, 2, 2.2, A1.. (there
are
unlimited amount of level and branches). I have tried with tree
collection with this, but doesn't seem to do the job... Sample code
will be much appreciated... Thank You!
 
D

Dave Sexton

Hi,

Does BOM stand for base object model?
If BOM is some special format that I'm unaware of then just ignore me ;)

I can't make any sense out of the data listing you have provided, the symbols you have chosen or your search results example.

1. Is your data supposed to be hierarchical?
a. Is that what you mean by "multiple levels and branches"?
2. Does each line represent a Parent --> Child relationship?
a. I suspect that this is the case, but then your results example doesn't make much sense to me unless the results are not
sorted, but that doesn't help much either.
3. Do the symbols that you have chosen represent some sort of Parent --> Child relationship?
a. If the symbols have no useful semantics than please provide an example that uses a 'uniform' language such as only letters or
only numbers.
b. If the symbols are meaningful then a tabular format is probably not the best way of illustrating that. Use an outline format
instead.
4. Are all of the lines in the 'Child' column children to each of the lines in the 'Father' column?
5. Is your search results example sorted in any way?
6. What are the rules for your data?
a. Does "unlimited amount of level and branches" mean that any "Father" can have any number of "Child" nodes, recursively and
infinitely?
b. Can two 'Father's share the same 'Child' or does a single 'Child' belong exclusively to one 'Father'?
i. Can there be multiple roots?
ii. Can a top level 'Father' also be the 'Child' of another node?
c. Is there anything else I'm forgetting to ask?
7. What are you trying to accomplish? i.e. Recursively searching for a single item, searching for multiple items or grouping and
statistical analysis.
8. .NET 2.0? (generics have potential to be useful)

If you could clear up these things and restate your question someone might be able to help you, and it might be me.
 
F

Fred Mellender

I think BOM means "bill of material". You are looking to do a depth first
search, I think. If so, look at
http://www.frontiernet.net/~fredm/dps/Contents.htm Chapter 3. You can
download the code to do the depth first search.

If you read the BOMP literature you might come across the notion of "low
level coding". If you wish to implement that, a breath first search is more
appropriate. The above link will show you how to do a breath first search.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top