need help for an algorithm...

From: Andreas Leitgeb (avl_at_gamma.logic.tuwien.ac.at)
Date: 10/27/04


Date: 27 Oct 2004 13:24:51 GMT

I've got a hexagonal grid (each cell has 6 neighbours), where some
cells are filled and some are empty. I'd need an algorithm to check,
if the set of filled cells is contiguous.

e.g. (x is filled, o is empty)
    o o o x x o x x
   o x o o x o x o
    o x x x x x o o
is contiguous, but
    o o o x x o x x
   o x o o o o x o
    o x x x x x o o
is not (first row, fourth & fifth item are separated from rest)

To simplify it (hopefully), I can rely on contiguousness at
start, and only need to recheck, if one "fill" of some cell
moves to another (previously empty) one.

PS: the grid itself is of course finite and always contiguous.



Relevant Pages

  • Re: Error Checking Code, Excel 2000 & 2003
    ... Sub ErrorCheckTEST() ... Dim cell as Range, cell1 as Range ... msg= "ERROR Description is empty" ... MsgBox "ERROR Description is empty" ...
    (microsoft.public.excel.programming)
  • Re: Delete Table Rows (Blank) Macro Question
    ... I wish to just delete the empty ... Dim pCell As Word.Cell ... If pCell.RowIndex> pCurrentRow Then ... 'Current cell is not empty? ...
    (microsoft.public.word.vba.general)
  • Re: Error Checking Code, Excel 2000 & 2003
    ... 'checks each cell in row have data or no data next row if all blank end ... MsgBox "ERROR Description is empty" ... MsgBox "ERROR Type is empty" ...
    (microsoft.public.excel.programming)
  • RE: Looping Through Variables
    ... i have always used Empty. ... In reference to clearing values in one instruction, its not the cell values ... Dim anyListEntry As Range ... Dim sourceWS As Worksheet ...
    (microsoft.public.excel.misc)
  • Re: Find First Row where "value" = ""
    ... Then when you need to add a new entry, you just add an entry to the list ... Populating all 65,536 rows is not efficient. ... The next cell then is empty of course. ...
    (microsoft.public.excel.programming)