Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 49
    • Issues 49
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the web forum at https://forum.skewed.de/c/graph-tool.


(If unsure, use the forum first.)


IMPORTANT: When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #729
Closed
Open
Issue created Feb 02, 2022 by Damian Lin@DamianLin2 of 3 checklist items completed2/3 checklist items

BFSVisitor initialize_vertex() not invoked

Bug reports:

Troubleshooting

  • Are you running the latest graph-tool version?
  • Do you observe the problem with the current git version?

I am afraid I haven't had a chance to build this, but I have replicated the bug on another device.

  • Did you compile graph-tool manually?

I installed graph-tool from the AUR.

Issue Summary

BFSVisitor's initialize_vertex() method is not being invoked on vertices. The program below terminates, instead of exiting with an error inside initialize_vertex().

Example:

import graph_tool.all as gt
import sys


class InitializeVisitor(gt.BFSVisitor):

    def initialize_vertex(self, u):
        print('This method appears to be bugged.')
        print('This code will terminate the program if it is reached.')
        sys.exit(1)

    def discover_vertex(self, u):
        print('This other method works fine.')


graph = gt.Graph()
a = graph.add_vertex()
b = graph.add_vertex()
c = graph.add_vertex()
d = graph.add_vertex()
graph.add_edge(a, b)
graph.add_edge(c, d)
graph.add_edge(a, c)

gt.bfs_search(graph, a, InitializeVisitor())
print('This should not be reached.')

Output:

This other method works fine.
This other method works fine.
This other method works fine.
This other method works fine.
This should not be reached.

System Information (both devices):

Operating System: Manjaro Linux Qonos 21.2.2
Python version: 3.10.1
Boost version: 1.78.0-1
Compiler version: g++ (GCC) 11.1.0
Edited Feb 02, 2022 by Damian Lin
Assignee
Assign to
Time tracking