This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Ordering of Blocks based on Input/Output


Consider the following block diagram showing five blocks 
B1 through B5 and six input-to-output connections C1 through
C6:
      C1               C2
|--|------>|  |---------------|--|
|B1|       |B2|               |B5|
|--|--.    |--|--.         .->|--|
      .        C4.         .
    C3.          .-->|--|  .C6
      .    |--|      |B4|--.
      .--->|B3|----->|--|
           |--| C5   

Starting from B1, there are only two ways to order the 
blocks so that each Block's inputs are provided by a
proceeding Block's output:

B1 , B2 , B3 , B4 , B5
B1 , B3 , B2 , B4 , B5

My problem is to produce *one* such feasible ordering of
the blocks. The attached XML fragments show how the system
has been represented. I need a method that will be fast
and efficient. How would you approach this problem?

Regards,

Dan
------------------------
<root>
 <system>
  <block>
   <name>B1</name>
   <output n="1">B1.Out1</output>
   <output n="2">B1.Out2</output>
  </block>
  <block>
   <name>B2</name>
   <output n="1">B2.Out1</output>
   <output n="2">B2.Out2</output>
  </block>
  <block>
   <name>B3</name>
   <output n="1">B3.Out1</output>
  </block>
  <block>
   <name>B4</name>
   <output n="1">B4.Out1</output>
  </block>
  <block>
   <name>B5</name>
   <output n="1">B5.Out1</output>
   <output n="2">B5.Out2</output>
  </block>

  <connect id="C1">
   <output block="B1" n="1"/>
   <input  block="B2" n="1"/>
  </connect>
  <connect id="C2">
   <output block="B2" n="1"/>
   <input  block="B5" n="1"/>
  </connect>
  <connect id="C3">
   <output block="B1" n="2"/>
   <input  block="B3" n="1"/>
  </connect>
  <connect id="C4">
   <output block="B2" n="2"/>
   <input  block="B4" n="1"/>
  </connect>
  <connect id="C5">
   <output block="B3" n="1"/>
   <input  block="B4" n="2"/>
  </connect>
  <connect id="C6">
   <output block="B4" n="1"/>
   <input  block="B5" n="2"/>
  </connect>
 </system>
</root>

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]